Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/23/01 11:06
Read: times


 
#16853 - RE: 8bit- bin value to 3 bcd values...
Simple:

mov a,binval ;a=value
mov b, #064h ;b=100
div ab ;divide value by 100
mov r0,a ;hundreds digit is in r0
mov a,b ;remainder in a
mov b,#0ah ;b=10
div ab ;divide by 10
mov r1,a ;tens digit is in r1
mov r2,b ;units digit is in r2

I don't think there's any simpler way of doing this :D
Kundi

List of 6 messages in thread
TopicAuthorDate
8bit- bin value to 3 bcd values...            01/01/70 00:00      
RE: 8bit- bin value to 3 bcd values...            01/01/70 00:00      
...and then I have to            01/01/70 00:00      
RE: ...and then I have to            01/01/70 00:00      
RE: ...and then I have to            01/01/70 00:00      
How to switch hex16bit to packaged_BCD ?            01/01/70 00:00      

Back to Subject List