Changes
/* Fast 32bit division */ a bit faster
'''Destroyed:''' AF,DE,IY
'''CPC Cycles:''' approximately 7800, 1900 usec
'''Size:''' 91 bytes
<pre>
ret ;IY,BC=Value1 DIV Value2
</pre>
== Fast 32bit division ==
'''Not used:''' IX, IY
'''CPC Cycles:''' 10801016-2572 2444 (1826 1730 on average), 270254-643 611 usec (456 432 on average) '''Size:''' 277 bytes
<pre>
div_r macro
local t2
ADC HL, HL
div_e macro
local t1,t2
ADC HL, HL
JR C, t1
t2
endm
DEC BC
LD A, B
EX (SP), HL
EX DE, HL
CALL DIV32FDIV32E
POP BC
RET
DIV16
CALL DIV32FDIV32E
LD BC, 0000
RET
endm
RET
DIV32E ; DE = HLDE/(-BC), HL = HLDE%(-BC)
CALL $+3