2 ; Ullrich von Bassewitz, 2011-07-10
4 ; CC65 runtime: 8x16 => 24 unsigned multiplication
7 .export umul8x16r24, umul8x16r24m
8 .export umul8x16r16, umul8x16r16m
10 .include "zeropage.inc"
14 ;---------------------------------------------------------------------------
15 ; 8x16 => 24 unsigned multiplication routine. Because the overhead for a
16 ; 8x16 => 16 unsigned multiplication routine is small, we will tag it with
17 ; the matching labels, as well.
19 ; routine LHS RHS result result also in
20 ; -----------------------------------------------------------------------
21 ; umul8x16r24 ax ptr1-low ax:sreg-low ptr1:sreg-low
22 ; umul8x16r24m ptr3 ptr1-low ax:sreg-low ptr1:sreg-low
24 ; ptr3 is left intact by the routine.
34 .if (.cpu .bitand ::CPU_ISET_65SC02)
43 ldy #8 ; Number of bits
44 ldx ptr3 ; Get into register for speed
46 ror a ; Get next bit into carry
65 sta ptr1 ; Save low byte of result
66 ldx ptr1+1 ; Load high byte of result