Captain Say
- Quote
- Posted: Sun, 12 Feb 2012 16:16:07 +0000
I've grown to be relatively dumb and am having a difficult time working with 68k assembly language
I have to write a small program where I ask a user input 2 ASCII characters, convert them to binary, add them, then convert it back to ASCII.
Without a modulus though, and the ability to use IF statements, I don't know how to do this.
I think I have the steps, but how to get to that is confusing me. Also, I have no idea if what I'm doing is even correct at this point. I'm a bit confused on data registers and always worried my information is going to be written over, so everything is saved in separate data registers only to be moved back later.
ALSO: Should I use MOVE.B #4? OR #5? I want to go back to #4 but a bit worried that's not it for some reason.
ALSO X2: I am aware I don't even have a back conversion done, and am a bit confused on that still, but I also just need to get one side working somehow.
EDIT: I posted it to Pastebin so I could shorten this thread and tack on one more question! Thanks for listening!
ASCII to Binary question --& http://pastebin.com/ptWhFQgT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SECOND QUESTION
I have to have a user input a string of 80 characters or less, and convert all lowercase to uppercase. I know this is done by subtracting $20 from the lowercase letters. So I tried to make a branch if the value is greater than or equal to $61, then subtract $20. But no matter how I warp this (I've tried less than, less than or equal to, etc), it keeps saying that line 22 is invalid.
Which is why the comments state the less than argument, the code just does greater than, and I'm at a loss.
I've tried both signed and unsigned op codes, but I thought ASCII was unsigned. Not sure what's going on here.
http://pastebin.com/G1NyHdwv
Thank you again!
I have to write a small program where I ask a user input 2 ASCII characters, convert them to binary, add them, then convert it back to ASCII.
Without a modulus though, and the ability to use IF statements, I don't know how to do this.
I think I have the steps, but how to get to that is confusing me. Also, I have no idea if what I'm doing is even correct at this point. I'm a bit confused on data registers and always worried my information is going to be written over, so everything is saved in separate data registers only to be moved back later.
ALSO: Should I use MOVE.B #4? OR #5? I want to go back to #4 but a bit worried that's not it for some reason.
ALSO X2: I am aware I don't even have a back conversion done, and am a bit confused on that still, but I also just need to get one side working somehow.
EDIT: I posted it to Pastebin so I could shorten this thread and tack on one more question! Thanks for listening!
ASCII to Binary question --& http://pastebin.com/ptWhFQgT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SECOND QUESTION
I have to have a user input a string of 80 characters or less, and convert all lowercase to uppercase. I know this is done by subtracting $20 from the lowercase letters. So I tried to make a branch if the value is greater than or equal to $61, then subtract $20. But no matter how I warp this (I've tried less than, less than or equal to, etc), it keeps saying that line 22 is invalid.
Which is why the comments state the less than argument, the code just does greater than, and I'm at a loss.
I've tried both signed and unsigned op codes, but I thought ASCII was unsigned. Not sure what's going on here.
http://pastebin.com/G1NyHdwv
Thank you again!