??? 06/05/05 19:36 Read: times |
#94369 - hextobcd conversion Responding to: ???'s previous message |
hi
Here is solution to your problem. I assume that you are doing coding in assembly language. there is a method of subtraction for this. suppose you have hex number in two registers say r1 and r2. r1-msb r2-lsb now first you subtract 10000 that is 2710h from this. lower byte first and then higher byte. i.e subtract 10h from r2 and 27h from r1. increment a register each time you can subtract. if there is a carry in subtraction then retrieve lsb bby adding 10h and subtract 1000 that is 03e8h and continue so on and increment a register each time you subtract without carry. you should get ans by this method. If you still have any questions there is a ready to use code in code library. |
Topic | Author | Date |
Hex to Dec Coversion Assembly code | 01/01/70 00:00 | |
back to math | 01/01/70 00:00 | |
Poor question | 01/01/70 00:00 | |
never underestimate anybody | 01/01/70 00:00 | |
If you want respect here... | 01/01/70 00:00 | |
At least you've achieved something | 01/01/70 00:00 | |
Net score | 01/01/70 00:00 | |
Format | 01/01/70 00:00 | |
DAA instruction helps BCD conversion | 01/01/70 00:00 | |
My quary to Raghunathan sir | 01/01/70 00:00 | |
May I ask a question? | 01/01/70 00:00 | |
Reply to Mr. Ijaz Ahmed | 01/01/70 00:00 | |
underestimating | 01/01/70 00:00 | |
How about ... | 01/01/70 00:00 | |
Looks OK | 01/01/70 00:00 | |
It can be easier to re-map a range..... | 01/01/70 00:00 | |
lookup table? | 01/01/70 00:00 | |
was thinking the same | 01/01/70 00:00 | |
hextobcd conversion![]() | 01/01/70 00:00 |