Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DE_mod_HL:
- ;Inputs:
- ; HL is an odd 16-bit number
- bit 7,h
- jr nz,$+6
- add hl,hl
- jp p,$-1 ;21
- ex de,hl
- ;DE is a modulus thingy
- ;HL is the number
- or a
- ModLoop:
- sbc hl,de ;15
- jr nc,$+3 ;12+6b
- add hl,de ;--
- sra d ;8
- rr e ;8
- jr nc,ModLoop;12|7
- ret
- ;1313 max
- ;76a+6b+83, a is at most 15, b is at most 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement