mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-20 18:30:59 +00:00
241 lines
3.6 KiB
Plaintext
241 lines
3.6 KiB
Plaintext
NEW
|
||
PREFIX
|
||
AUTO 4,1
|
||
*---------------------------------------
|
||
OUT.Init lda #20
|
||
>STA.G OUT.LineCnt
|
||
rts
|
||
*---------------------------------------
|
||
OUT.Reset ldx #4
|
||
|
||
ldy #ASM.PC
|
||
|
||
.1 lda (pData),y
|
||
pha
|
||
iny
|
||
dex
|
||
bne .1
|
||
|
||
ldx #4
|
||
|
||
ldy #OUT.PC+3
|
||
|
||
.2 pla
|
||
sta (pData),y
|
||
dey
|
||
dex
|
||
bne .2
|
||
|
||
>STZ.G OUT.Buf
|
||
>STA.G OUT.bEquate
|
||
|
||
rts
|
||
*---------------------------------------
|
||
OUT.PrintLineErr
|
||
>STA.G DIR.Byte Save Error code
|
||
|
||
jsr OUT.PrintLine.1
|
||
bcs .9
|
||
|
||
.1 >PUSHB.G DIR.Byte
|
||
>PUSHBI 1
|
||
>LDYA L.MSG.ERROR
|
||
>SYSCALL printf
|
||
|
||
ldx ZPLinePtr
|
||
cpx ZPLineBuf
|
||
beq .4
|
||
|
||
.3 phx
|
||
lda #'-'
|
||
>SYSCALL PutChar
|
||
plx
|
||
bcs .9
|
||
dex
|
||
cpx ZPLineBuf
|
||
bne .3
|
||
|
||
.4 lda #'^'
|
||
phy
|
||
>SYSCALL PutChar
|
||
ply
|
||
bcs .9
|
||
|
||
.5 lda #13
|
||
>SYSCALL PutChar
|
||
lda #10
|
||
>SYSCALL PutChar
|
||
|
||
.9 rts
|
||
*---------------------------------------
|
||
OUT.PrintLine jsr OUT.PrintLineOn
|
||
bcs OUT.PrintLine.9
|
||
|
||
OUT.PrintLine.1 jsr OUT.PrintLineOutBuf
|
||
bcs OUT.PrintLine.9
|
||
|
||
>PUSHW ZPLineBuf
|
||
>PUSHW.G SRC.LINENUM
|
||
>PUSHBI 4
|
||
>LDYA L.MSG.SRCLINE
|
||
jmp OUT.Print
|
||
OUT.PrintLine.9 rts
|
||
*---------------------------------------
|
||
OUT.PrintLineOn clc
|
||
rts
|
||
|
||
>LDA.G ASM.LI.ON
|
||
bpl .9
|
||
|
||
>LDA.G ASM.MA.ON MACRO Mode ?
|
||
bpl .1
|
||
|
||
>LDA.G ASM.LI.MON
|
||
bpl .9
|
||
bmi .8
|
||
|
||
.1 >LDA.G ASM.DO.StackPtr within a DO/ELSE ?
|
||
beq .2
|
||
|
||
clc
|
||
adc #ASM.DO.Stack-1
|
||
tay
|
||
lda (pData),y TRUE ?
|
||
bne .8 yes, print always
|
||
|
||
>LDA.G ASM.LI.CON FALSE, check CON flag...
|
||
bpl .9
|
||
bmi .8
|
||
|
||
.2
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
.9 sec
|
||
rts
|
||
*---------------------------------------
|
||
OUT.PrintLineOutBuf
|
||
>LDA.G OUT.bEquate
|
||
bne OUT.PrintLineAcc
|
||
|
||
>LDA.G OUT.Buf
|
||
beq .2
|
||
|
||
tax
|
||
clc
|
||
adc #OUT.Buf
|
||
tay
|
||
|
||
.1 >PUSHB (pData),y
|
||
dey
|
||
dex
|
||
bne .1
|
||
|
||
.2 ldy #OUT.PC+1
|
||
>PUSHB (pData),y
|
||
dey
|
||
>PUSHB (pData),y
|
||
|
||
>LDA.G OUT.Buf
|
||
pha
|
||
inc
|
||
inc
|
||
>PUSHA Byte Count+2 for PC
|
||
pla
|
||
asl
|
||
tax
|
||
ldy L.MSG.OUT0,x
|
||
lda L.MSG.OUT0+1,x
|
||
>SYSCALL printf
|
||
rts
|
||
|
||
OUT.PrintLineAcc
|
||
ldx SRC.ACC.SIZE
|
||
beq .2
|
||
|
||
ldy #0
|
||
|
||
.1 >PUSHB SRC.ACC,y
|
||
iny
|
||
dex
|
||
bne .1
|
||
|
||
lda SRC.ACC.SIZE
|
||
>PUSHA Byte Count
|
||
asl
|
||
tax
|
||
|
||
.2 ldy L.MSG.EQU0,x
|
||
lda L.MSG.EQU0+1,x
|
||
>SYSCALL printf
|
||
rts
|
||
*---------------------------------------
|
||
OUT.Print >SYSCALL printf
|
||
bra OUT.Print1
|
||
|
||
OUT.PrintCR lda #13
|
||
>SYSCALL PutChar
|
||
lda #10
|
||
>SYSCALL PutChar
|
||
|
||
OUT.Print1 >DEC.G OUT.LineCnt
|
||
bne .8
|
||
|
||
lda #20
|
||
sta (pData),y
|
||
|
||
lda #$80
|
||
>STA.G bPause
|
||
|
||
.8 rts
|
||
*---------------------------------------
|
||
OUT.EmitByte phy
|
||
phx
|
||
pha
|
||
|
||
>LDA.G OUT.Buf
|
||
cmp #3
|
||
bne .2
|
||
|
||
jsr OUT.PrintLineOn
|
||
bcs .1
|
||
|
||
>LDA.G ASM.LI.XON
|
||
bpl .1
|
||
|
||
jsr OUT.PrintLineOutBuf
|
||
jsr OUT.PrintCR
|
||
|
||
.1 jsr OUT.Reset
|
||
|
||
lda #0
|
||
ldy #OUT.Buf
|
||
|
||
.2 inc
|
||
sta (pData),y
|
||
clc
|
||
adc #OUT.Buf
|
||
tay
|
||
|
||
pla
|
||
sta (pData),y
|
||
|
||
.8 >INC.G ASM.PC
|
||
bne .80
|
||
>INC.G ASM.PC+1
|
||
bne .80
|
||
>INC.G ASM.PC+2
|
||
bne .80
|
||
>INC.G ASM.PC+3
|
||
|
||
.80 plx
|
||
ply
|
||
clc
|
||
rts
|
||
*---------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/BIN/ASM.S.OUT
|
||
LOAD USR/SRC/BIN/ASM.S
|
||
ASM
|