Advertisement
Zeda

DE_Times_BC

Jan 4th, 2012
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DE_Times_BC:
  2. ;Inputs:
  3. ;     DE and BC are factors
  4. ;Outputs:
  5. ;     A is 0
  6. ;     BC is not changed
  7. ;     DEHL is the product
  8. ;
  9.        ld hl,0
  10.        ld a,16
  11. Mul_Loop_1:
  12.          add hl,hl
  13.          rl e \ rl d
  14.          jr nc,$+4
  15.            add hl,bc
  16.            inc de
  17.          dec a
  18.          jr nz,Mul_Loop_1
  19.        ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement