; Do a subtraction. we do not have enough space to store the intermediate
; result, so we may have to do the subtraction twice.
- pha
+ tax
cmp ptr3
lda ptr2+1
sbc ptr3+1
; Overflow, do the subtraction again, this time store the result
sta tmp4 ; We have the high byte already
- pla
+ txa
sbc ptr3 ; byte 0
- pha
+ tax
lda ptr2+1
sbc ptr3+1
sta ptr2+1 ; byte 1
sta tmp3 ; byte 2
inc ptr1 ; Set result bit
-L1: pla
+L1: txa
dey
bne L0
sta ptr2
.include "zeropage.inc"
+ .macpack cpu
;---------------------------------------------------------------------------
; 8x16 => 24 unsigned multiplication routine. Because the overhead for a
umul8x16r24m:
umul8x16r16m:
+.if (.cpu .bitand ::CPU_ISET_65SC02)
+ stz ptr1+1
+ stz sreg
+.else
ldx #0
stx ptr1+1
stx sreg
+.endif
ldy #8 ; Number of bits
ldx ptr3 ; Get into register for speed