Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;===============================================================
- DEHL_Times_A:
- ;===============================================================
- ;Inputs:
- ; DEHL is a 32 bit factor
- ; A is an 8 bit factor
- ;Outputs:
- ; interrupts disabled
- ; BC is not changed
- ; AHLDE is the 40-bit result
- ; D'E' is the lower 16 bits of the input
- ; H'L' is the lower 16 bits of the output
- ; B' is 0
- ; C' is not changed
- ; A' is not changed
- ;===============================================================
- di
- push hl
- or a
- sbc hl,hl
- exx
- pop de
- sbc hl,hl
- ld b,8
- mul32Loop:
- add hl,hl
- rl e \ rl d
- add a,a
- jr nc,$+8
- add hl,de
- exx
- adc hl,de
- inc a
- exx
- djnz mul32Loop
- push hl
- exx
- pop de
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement