| Thread Closed |
Assembly language. conversion. |
Share Thread |
| Mar17-09, 10:06 PM | #1 |
|
|
Assembly language. conversion.
Assembly language. how to change the 80h in my register to 50h?
that goes to others to. like 45h to 2Dh. basically, i came up with a sequence to change the user's double digit decimal input to hex value. i.e. when i enter 45, AL = 45h how do i change it to 2Dh?? ; al = 45h. how to change it to 2Dh? 45(decimal) = 2Dh. must be able to do this for other conversion. |
| Mar18-09, 04:20 AM | #2 |
|
|
If that's the case, you can simply multiply the first byte by 10, and add it to the second byte. Simple base 10 long form, as you probably did in elementary. In this case, 4 x 10 is 40 is 0x28 and when you add 5 to it, you get 0x2d, as in your example. If instead, it's packed into one byte, you'll need to do some masking and shifting before multiplying the 10s digit by 10 and adding it to the 1s digit. The actual implementation is left as a task to the user. |
| Thread Closed |
Similar discussions for: Assembly language. conversion.
|
||||
| Thread | Forum | Replies | ||
| Assembly Language | Electrical Engineering | 10 | ||
| Assembly Language | Engineering, Comp Sci, & Technology Homework | 0 | ||
| Assembly language | Electrical Engineering | 5 | ||
| *****need help programing in assembly language***** | Programming & Comp Sci | 1 | ||
| Turbo Assembly Language | Computing & Technology | 2 | ||