converting to binary in assembly
| cannsyl (43) | |||
| Hi I am very new to assembly. I am trying to convert some numbers to binary. I have written most of the code so far, but can't figure out how to convert to binary. The user enters a number that number is stored in one register in another final register initialized to 0 the value is multiplied by 10 and the stored number is added so that if the user enters 1 the answer is one if they then enter a 2 the answer is 12, and so on. I then have to convert the final number entered to binary. That is where I am stuck. Here is what I have so far...I have been trying test, but that doesnt seem to work.
| |||
| guestgulkan (481) | |||
| I think you may be confused.. the value in the edx register IS in binary form. If the user entered '16' (as ascii letters from the keyboard) then after your conversion the actual value in edx is 16 (sixteen) and the (32 bit) edx register looks like this: 00000000000000000000000000010000 Do you mean that you want to re-display what the user entered but as a series of ones and zeros?? | |||
| Zaita (1576) | |||
| *cough* This is a C++ forum, not an ASM forum *cough* | |||
This topic is archived - New replies not allowed.
