mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-26 13:49:18 +00:00
124 lines
1.7 KiB
Plaintext
124 lines
1.7 KiB
Plaintext
|
NEW
|
|||
|
AUTO 3,1
|
|||
|
*--------------------------------------
|
|||
|
ACC32.Sign .EQ FAC
|
|||
|
ACC32 .EQ FAC+1
|
|||
|
*--------------------------------------
|
|||
|
NUM.A2STR10 jsr NUM.A2ACC32
|
|||
|
clc
|
|||
|
*--------------------------------------
|
|||
|
* CS = signed long
|
|||
|
* CC = unsigned long
|
|||
|
*--------------------------------------
|
|||
|
NUM.ACC322STR10 bcc .1
|
|||
|
|
|||
|
clc
|
|||
|
|
|||
|
lda ACC32+3
|
|||
|
bpl .1
|
|||
|
|
|||
|
jsr NUM.ACC32NEG
|
|||
|
|
|||
|
sec
|
|||
|
|
|||
|
.1 php
|
|||
|
|
|||
|
ldx #4
|
|||
|
|
|||
|
.2 stz RESULT,x Clear all 5 bytes
|
|||
|
dex
|
|||
|
bpl .2
|
|||
|
|
|||
|
sed switch to BCD mode
|
|||
|
|
|||
|
ldx #32 let's roll 32 bits
|
|||
|
|
|||
|
.3 asl ACC32
|
|||
|
rol ACC32+1
|
|||
|
rol ACC32+2
|
|||
|
rol ACC32+3
|
|||
|
|
|||
|
ldy #4
|
|||
|
|
|||
|
.4 lda RESULT,y
|
|||
|
adc RESULT,y
|
|||
|
sta RESULT,y
|
|||
|
dey
|
|||
|
bpl .4
|
|||
|
|
|||
|
dex
|
|||
|
bne .3
|
|||
|
|
|||
|
cld
|
|||
|
|
|||
|
ldy #0
|
|||
|
* ldx #0
|
|||
|
|
|||
|
plp
|
|||
|
bcc .5
|
|||
|
|
|||
|
lda #'-'
|
|||
|
sta $102,x
|
|||
|
inx
|
|||
|
|
|||
|
.5 stz $102,x
|
|||
|
|
|||
|
.50 tya
|
|||
|
lsr
|
|||
|
tay
|
|||
|
lda RESULT,y
|
|||
|
|
|||
|
bcs .6
|
|||
|
|
|||
|
lsr
|
|||
|
lsr
|
|||
|
lsr
|
|||
|
lsr
|
|||
|
|
|||
|
.6 and #$0F
|
|||
|
ora #$30
|
|||
|
cmp #$30
|
|||
|
|
|||
|
lda $102,x
|
|||
|
sta $102,x
|
|||
|
|
|||
|
.7 sta $102,x
|
|||
|
inx
|
|||
|
|
|||
|
.8 iny
|
|||
|
cpy #10
|
|||
|
bne .50
|
|||
|
|
|||
|
stz $102,x
|
|||
|
|
|||
|
clc
|
|||
|
.99 rts
|
|||
|
*--------------------------------------
|
|||
|
NUM.A2ACC32 sta ACC32
|
|||
|
.HS 2C BIT ABS
|
|||
|
NUM.ACC32ZERO stz ACC32
|
|||
|
stz ACC32+1
|
|||
|
stz ACC32+2
|
|||
|
stz ACC32+3
|
|||
|
rts
|
|||
|
*--------------------------------------
|
|||
|
NUM.ACC32NEG sec
|
|||
|
|
|||
|
ldy #0
|
|||
|
ldx #3
|
|||
|
|
|||
|
.1 lda ACC32,y two's complement of X bytes
|
|||
|
eor #$ff
|
|||
|
adc #0
|
|||
|
sta ACC32,y
|
|||
|
iny
|
|||
|
dex
|
|||
|
bpl .1
|
|||
|
|
|||
|
rts
|
|||
|
*--------------------------------------
|
|||
|
MAN
|
|||
|
SAVE USR/SRC/SYS/KERNEL.S.NUM
|
|||
|
LOAD USR/SRC/SYS/KERNEL.S
|
|||
|
ASM
|