Changes

Jump to: navigation, search

Programming:Integer Division

15 bytes added, 13:27, 26 December 2015
/* 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:''' 261 277 bytes
<pre>
div_r macro
local t2
EX DE, HL ADD SLA HL, HLE EX RL DE, HLD
ADC HL, HL
div_e macro
local t1,t2
EX DE, HL ADD SLA HL, HLE EX RL DE, HLD
ADC HL, HL
JR C, t1
22
edits