| ★ CODING ★ SOURCES ★ CODING Source &015 - Division 16 bits ★ |
| Division 16 bits | Coding Sources |
; ; October 1997 ; ; ; return rounded result in DE .divide ld de,0 .div_lp or a sbc hl,bc jr c,div_ad ;Adjustment if carry inc de ret z ;Return if exactly right jr div_lp ;Else loop .div_ad add hl,bc ;Restore to previous value or a rr b rr c ;Halve BC or a sbc hl,bc ;And compare with HL ret c inc de ret ;Increase DE if HL 0 or more |
| ![]() |
|