Advertisement
Zeda

DE_Times_A

Jan 4th, 2012
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DE_Times_A:
  2. ;Inputs:
  3. ;     DE and A are factors
  4. ;Outputs:
  5. ;     A is not changed
  6. ;     B is 0
  7. ;     C is not changed
  8. ;     DE is not changed
  9. ;     HL is the product
  10. ;Time:
  11. ;     342+6x
  12. ;     x is the number of bits in A
  13.      ld b,8          ;7           7
  14.      ld hl,0         ;10         10
  15.        add hl,hl     ;11*8       88
  16.        rlca          ;4*8        32
  17.        jr nc,$+3     ;(12|18)*8  96+6x
  18.          add hl,de   ;--         --
  19.        djnz $-5      ;13*7+8     99
  20.      ret             ;10         10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement