mirror of
https://github.com/stid/woz64.git
synced 2024-11-22 11:32:29 +00:00
38 lines
745 B
NASM
38 lines
745 B
NASM
#importonce
|
|
.filenamespace Math
|
|
|
|
|
|
* = * "Math Routines"
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
multiply: {
|
|
sei
|
|
pha
|
|
txa
|
|
pha
|
|
|
|
lda #$00
|
|
ldx #$08
|
|
clc
|
|
m0: bcc.r m1
|
|
clc
|
|
adc MemMap.MATH.factor2
|
|
m1: ror
|
|
ror MemMap.MATH.factor1
|
|
dex
|
|
bpl.r m0
|
|
ldx MemMap.MATH.factor1
|
|
|
|
sta MemMap.MATH.result
|
|
stx MemMap.MATH.result+1
|
|
|
|
pla
|
|
tax
|
|
pla
|
|
cli
|
|
rts
|
|
}
|
|
|
|
#import "mem_map.asm"
|