Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a_div_b:
- ld c,a
- c_div_b:
- ;Inputs:
- ; C is the numerator
- ; B is the denominator (less than 128)
- ;Outputs:
- ; A is the quotient
- ; C is -1/2 the quotient
- ; B,D,E,H,L are not changed
- ;242cc to 250cc
- ;61 bytes
- xor a
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- rl c \ rla \ cp b \ jr c,$+3 \ sub b
- ld a,c \ rla \ cpl
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement