2011-07-10 14:52:35 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 2011-07-10
|
|
|
|
;
|
|
|
|
; CC65 library: 16x8 => 32 unsigned multiplication
|
|
|
|
;
|
|
|
|
|
2019-03-29 21:36:01 +00:00
|
|
|
.export _umul16x8r32
|
2011-07-10 14:52:35 +00:00
|
|
|
.import umul8x16r24, popax
|
|
|
|
|
|
|
|
.include "zeropage.inc"
|
|
|
|
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------------
|
|
|
|
; 16x8 => 32 unsigned multiplication routine. We use 8x16 => 24 and clear
|
|
|
|
; the high byte of the result
|
|
|
|
|
2019-03-29 21:36:01 +00:00
|
|
|
.proc _umul16x8r32
|
2011-07-10 14:52:35 +00:00
|
|
|
|
|
|
|
sta ptr1
|
|
|
|
lda #0
|
|
|
|
sta sreg+1 ; Clear high byte of result
|
|
|
|
jsr popax
|
|
|
|
jmp umul8x16r24
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|