Advertisement
sci4me

spu0 division by subtraction

Jun 12th, 2015
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. divide:
  2. ldi r2 0
  3. mov r3 r0
  4. divide_loop:
  5. push r3
  6. ldi r3 1
  7. add r2 r3
  8. pop r3
  9.  
  10. sub r3 r1
  11.  
  12. blt r3 r1 divide_end
  13. jmp divide_loop
  14. divide_end:
  15. ldi r0 0
  16. ldi r1 0
  17. rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement