Advertisement
Zeda

C_Div_D

Jan 4th, 2012
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. C_Div_D:
  2. ;Inputs:
  3. ;     C is the numerator
  4. ;     D is the denominator
  5. ;Outputs:
  6. ;     A is the remainder
  7. ;     B is 0
  8. ;     C is the result of C/D
  9. ;     D,E,H,L are not changed
  10. ;
  11.      ld b,8
  12.      xor a
  13.        sla c
  14.        rla
  15.        cp d
  16.        jr c,$+4
  17.          inc c
  18.          sub d
  19.        djnz $-8
  20.      ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement