Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RoundHL_Div_C:
- ;Inputs:
- ; HL is the numerator
- ; C is the denominator
- ;Outputs:
- ; A is twice the remainder of the unrounded value
- ; B is 0
- ; C is not changed
- ; DE is not changed
- ; HL is the rounded quotient
- ; c flag set means no rounding was performed
- ; reset means the value was rounded
- ;
- ld b,16
- xor a
- add hl,hl
- rla
- cp c
- jr c,$+4
- inc l
- sub c
- djnz $-7
- add a,a
- cp c
- jr c,$+3
- inc hl
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement