Advertisement
Zeda

DEHL_Div_C

Jan 4th, 2012
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DEHL_Div_C:
  2. ;Inputs:
  3. ;     DEHL is a 32 bit value where DE is the upper 16 bits
  4. ;     C is the value to divide DEHL by
  5. ;Outputs:
  6. ;    A is the remainder
  7. ;    B is 0
  8. ;    C is not changed
  9. ;    DEHL is the result of the division
  10. ;
  11.      ld b,32
  12.      xor a
  13.        add hl,hl
  14.        rl e \ rl d
  15.        rla
  16.        cp c
  17.        jr c,$+4
  18.          inc l
  19.          sub c
  20.        djnz $-10
  21.      ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement