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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/14/00 19:43
Read: times


 
#3204 - RE: Division...
Hi All,

Can someone please tell me what is wrong with this code? I tried the DIV AB command with no success. When I do the following computation, 128/255, I get zero in mem location 02h and 128 in 03h. I need to get 0.50196078...etc. Here is my code.

org 21e1h
b data 0f0h
acc data 0e0h
mov dptr,#0000h
movx a,@dptr ; get 128
push acc
mov dptr,#0001h
movx a,@dptr ; get 255
push acc
pop b
pop acc
div ab
mov dptr,#0002h ; output quotient
movx @dptr,a
mov a,b
mov dptr,#0003h ; output remainder
movx @dptr,a
ret
end

Thanks,
Dave Kaleta



List of 9 messages in thread
TopicAuthorDate
Division...            01/01/70 00:00      
RE: Division...            01/01/70 00:00      
RE: Division...            01/01/70 00:00      
RE: Division...            01/01/70 00:00      
Filling in the answers to Lab 101            01/01/70 00:00      
RE: Division...            01/01/70 00:00      
RE: Division...            01/01/70 00:00      
RE: Division...            01/01/70 00:00      
RE: Division...            01/01/70 00:00      

Back to Subject List