Advertisement
Guest User

Untitled

a guest
May 28th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. mov r0, #027h ;divident high
  2. mov r1, #015h; divident low
  3. mov r2, #007h;divider high
  4. mov r3, #0d0h; divider low
  5. mov r5, #00h
  6. mov r4, #00h
  7. ;3 0000 -2000
  8. ; r0 r1
  9. ;: r2 r3
  10. ;________
  11. ; = r4 r5
  12. sub_again:
  13. cjne r0, #0,start_sub
  14. cjne r1, #0, start_sub
  15. ljmp end
  16. start_sub:
  17. clr c
  18. mov a, r1
  19. subb a, r3
  20. mov r1, a
  21. jc ovf1
  22. cont1:
  23. mov a,r0
  24. subb a, r2
  25. mov r0,a
  26. jnc inc_result
  27. ljmp end;
  28. ovf1:
  29. clr c ; better safe than sorry
  30. dec r0
  31. ljmp cont1
  32. inc_result:
  33. inc r5;
  34. cjne r5,#0h, sub_again
  35. inc_result2dig:
  36. inc r4
  37. ljmp sub_again
  38. end :ljmp end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement