mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-25 19:30:44 +00:00
Kernel 0.92
This commit is contained in:
parent
b2a3dc25fe
commit
d9a3b4eb87
61
X.M32.S.txt
Normal file
61
X.M32.S.txt
Normal file
@ -0,0 +1,61 @@
|
||||
NEW
|
||||
PREFIX
|
||||
AUTO 4,1
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
* Uses: (pData)
|
||||
* M32.ACC .BS 4
|
||||
* M32.ARG .BS 4
|
||||
* M32.TMP .BS 4
|
||||
*--------------------------------------
|
||||
M32.Add ldx #0 ARG-ACC->ACC
|
||||
ldy #4
|
||||
|
||||
clc
|
||||
|
||||
.1 lda M32.ARG,x
|
||||
adc M32.ACC,x
|
||||
sta M32.ACC,x
|
||||
inx
|
||||
dey
|
||||
bne .1
|
||||
|
||||
rts if CS, Overflow
|
||||
*---------------------------------------
|
||||
M32.Sub ldx #0 ARG-ACC->ACC
|
||||
ldy #4
|
||||
|
||||
sec
|
||||
|
||||
.1 lda M32.ARG,x
|
||||
sbc M32.ACC,x
|
||||
sta M32.ACC,x
|
||||
inx
|
||||
dey
|
||||
bne .1
|
||||
|
||||
bcs .8 if CC, Overflow
|
||||
|
||||
sec
|
||||
rts
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
* http://6502.org/source/integers/32muldiv.htm
|
||||
*--------------------------------------
|
||||
M32.Mul
|
||||
*--------------------------------------
|
||||
M32.Div
|
||||
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
M32.Mod
|
||||
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/X.M32.S
|
Loading…
Reference in New Issue
Block a user