== Very fast 8bit * 8bit Unsigned with only 1K of tables ==
'''Input:''': B A = ''Multiplier'', C L = Multiplicant''Multiplicand''
'''Output:''': DE = ''Product''
'''CPC Cycles''': 104-112 (108 on average) = 26-28 (27) usec
Now for the actual multiply routine:
'''Input:''' A = ''Multiplier'', L = ''Multiplicand''
'''Output:''' DE = ''Product''
<pre>
ld h,umul_tab_lo / #100 ; 2
Fast 8 bit unsigned multiplication with 16 bit result. It uses formula
<prebr> x*y = ((x+y)/2)^<sup>2 </sup> - ((x-y)/2)^<sup>2</sup>, if x+y is even <br> = ((x+y-1)/2)^<sup>2 </sup> - ((x-y-1)/2)^<sup>2 </sup> + y, if x+y is odd and x>=y</pre>
<pre> cp b
[[User:Litwr|Litwr]] 10:25, 24 October 2015 (CEST)
== 16bit * 16bit Unsigned -> 32 bits result == '''Input:''' BC = ''Multiplier'', DE = ''Multiplicand'' '''Output:''' DE,HL = ''Product''<pre>ld hl,0ld a,16muluw add hl,hl rl e rl d jr nc,muluw_cont add hl,bc jr nc,muluw_cont inc demuluw_cont dec a jr nz,muluw</pre> == 16bit * 16bit Unsigned -> 24 bits result ==
'''Input:''' BC = ''Multiplier'', DE = ''Multiplicand''