mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-19 12:31:56 +00:00
337 lines
4.9 KiB
Plaintext
337 lines
4.9 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*---------------------------------------
|
||
OUT.Init lda #PAGE.LEN
|
||
>STA.G OUT.LineCnt
|
||
clc
|
||
rts
|
||
*---------------------------------------
|
||
OUT.EmitByte phy
|
||
phx
|
||
tax
|
||
|
||
>LDA.G ASM.PASS
|
||
beq .1
|
||
|
||
>LDA.G ASM.DU.ON
|
||
bmi .1
|
||
|
||
txa
|
||
pha
|
||
>PUSHA
|
||
>LDA.G DST.hREFNUM
|
||
>SYSCALL FPutC
|
||
plx
|
||
bcs .99
|
||
|
||
.1 >INC.G ASM.PC
|
||
bne .2
|
||
>INC.G ASM.PC+1
|
||
bne .2
|
||
>INC.G ASM.PC+2
|
||
bne .2
|
||
>INC.G ASM.PC+3
|
||
|
||
.2 >LDA.G ASM.PH.ON
|
||
beq .3
|
||
|
||
>INC.G ASM.PC.PH
|
||
bne .3
|
||
>INC.G ASM.PC.PH+1
|
||
bne .3
|
||
>INC.G ASM.PC.PH+2
|
||
bne .3
|
||
>INC.G ASM.PC.PH+3
|
||
|
||
.3 >LDA.G OUT.Buf
|
||
cmp #3
|
||
bne .4
|
||
|
||
phx
|
||
jsr OUT.PrintBuf
|
||
plx
|
||
bcs .99
|
||
|
||
ldy #OUT.Buf
|
||
lda #0
|
||
|
||
.4 inc
|
||
sta (pData),y
|
||
clc
|
||
adc #OUT.Buf
|
||
tay
|
||
txa
|
||
sta (pData),y
|
||
|
||
.8 clc
|
||
|
||
.99 plx
|
||
ply
|
||
rts
|
||
*---------------------------------------
|
||
OUT.PrintBuf jsr OUT.PrintLineOn
|
||
bcs OUT.PrintBufReset
|
||
|
||
>LDA.G ASM.LI.XON
|
||
bpl OUT.PrintBufReset
|
||
|
||
jsr OUT.PrintLineOutBuf
|
||
bcs OUT.PrintBuf.RTS
|
||
jsr OUT.PrintCR
|
||
bcs OUT.PrintBuf.RTS
|
||
|
||
OUT.PrintBufReset
|
||
>STZ.G OUT.Buf
|
||
|
||
ldx #4
|
||
ldy #ASM.PC
|
||
|
||
.2 lda (pData),y
|
||
pha
|
||
iny
|
||
dex
|
||
bne .2
|
||
|
||
ldx #4
|
||
ldy #OUT.PC+3
|
||
|
||
.3 pla
|
||
sta (pData),y
|
||
dey
|
||
dex
|
||
bne .3
|
||
|
||
.8 clc
|
||
|
||
OUT.PrintBuf.RTS
|
||
rts
|
||
*---------------------------------------
|
||
OUT.PrintLine jsr OUT.PrintLineOn
|
||
bcs OUT.PrintBuf.RTS
|
||
|
||
OUT.PrintLine.1 jsr OUT.PrintLineOutBuf
|
||
bcs OUT.PrintBuf.RTS
|
||
|
||
>LDA.G SRC.Depth
|
||
|
||
.1 dec
|
||
beq .2
|
||
|
||
pha
|
||
lda #'>'
|
||
>SYSCALL PutChar
|
||
pla
|
||
bra .1
|
||
|
||
.2 >PUSHW L.MSG.LINENUM
|
||
>PUSHW.G SRC.LINENUM
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
|
||
>LDA.G MAC.CtxStackPtr
|
||
|
||
.3 dec
|
||
bmi .4
|
||
|
||
pha
|
||
lda #'>'
|
||
>SYSCALL PutChar
|
||
pla
|
||
bra .3
|
||
|
||
.4 >LDYA ZPLineBuf
|
||
>SYSCALL PutS
|
||
|
||
jmp OUT.PrintCR1
|
||
*---------------------------------------
|
||
OUT.PrintLineOutBuf
|
||
>LDA.G OUT.bEquate
|
||
bne OUT.PrintLineEQU
|
||
|
||
>LDA.G OUT.Buf
|
||
pha
|
||
asl
|
||
tax
|
||
>PUSHB L.MSG.OUT0+1,x
|
||
>PUSHB L.MSG.OUT0,x
|
||
|
||
ldy #OUT.PC+1
|
||
>PUSHB (pData),y
|
||
dey
|
||
>PUSHB (pData),y
|
||
|
||
pla
|
||
beq .2
|
||
|
||
tax
|
||
|
||
ldy #OUT.Buf
|
||
|
||
pha
|
||
|
||
.1 iny
|
||
>PUSHB (pData),y
|
||
dex
|
||
bne .1
|
||
|
||
pla
|
||
|
||
.2 inc
|
||
inc
|
||
>PUSHA Byte Count+2 for PC
|
||
>SYSCALL PrintF
|
||
|
||
rts
|
||
*---------------------------------------
|
||
OUT.PrintLineEQU
|
||
lda SRC.ACC.SIZE
|
||
asl
|
||
tax
|
||
|
||
>PUSHB L.MSG.EQU0+1,x
|
||
>PUSHB L.MSG.EQU0,x
|
||
|
||
lda SRC.ACC.SIZE
|
||
beq .2
|
||
|
||
tay
|
||
|
||
.1 dey
|
||
>PUSHB SRC.ACC,y
|
||
tya
|
||
bne .1
|
||
|
||
lda SRC.ACC.SIZE
|
||
|
||
.2 >PUSHA Byte Count
|
||
>SYSCALL PrintF
|
||
rts
|
||
*---------------------------------------
|
||
OUT.PrintLineOn
|
||
>LDA.G bListAll
|
||
bmi .8
|
||
|
||
>LDA.G ASM.LI.ON
|
||
bpl .9
|
||
|
||
>LDA.G ASM.MA.ON MACRO Mode ?
|
||
bmi .1
|
||
|
||
>LDA.G MAC.CtxID within MACRO ?
|
||
beq .11
|
||
|
||
.1 >LDA.G ASM.LI.MON
|
||
bpl .9
|
||
clc
|
||
rts
|
||
|
||
.11 >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
|
||
clc
|
||
rts
|
||
|
||
.2
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
.9 sec
|
||
OUT.PrintLineOnRTS
|
||
rts
|
||
*---------------------------------------
|
||
OUT.PrintLineErr
|
||
sta DIR.Byte Save Error code
|
||
|
||
jsr OUT.PrintLine.1
|
||
bcs OUT.PrintLineOnRTS
|
||
|
||
.1 >PUSHW L.MSG.ERROR
|
||
>PUSHB DIR.Byte
|
||
>PUSHBI 1
|
||
>SYSCALL PrintF
|
||
|
||
lda ZPLinePtr
|
||
sec
|
||
sbc ZPLineBuf
|
||
jsr OUT.PrintLineErrDashA
|
||
|
||
>LDA.G SRC.Depth
|
||
dec
|
||
jsr OUT.PrintLineErrDashA
|
||
|
||
>LDA.G MAC.CtxStackPtr
|
||
jsr OUT.PrintLineErrDashA
|
||
|
||
lda #'^'
|
||
>SYSCALL PutChar
|
||
bcs OUT.PrintLineOnRTS
|
||
|
||
jsr OUT.PrintCR
|
||
|
||
>PUSHW L.MSG.PASS
|
||
>LDA.G ASM.PASS
|
||
inc
|
||
>PUSHA
|
||
>PUSHBI 1
|
||
jsr OUT.Print
|
||
|
||
.DO ASMDBG=1
|
||
>PUSHW L.MSG.EQU0+2
|
||
>PUSHB (ZPSymbolBuf) flags
|
||
>PUSHBI 1
|
||
>SYSCALL printf
|
||
|
||
>LDYA L.MSG.CRLF
|
||
>STYA ZPTmpBuf
|
||
jsr SYM.Dump.GLP
|
||
.FIN
|
||
|
||
jmp OUT.PrintCR
|
||
*---------------------------------------
|
||
OUT.PrintLineErrDashA
|
||
tax
|
||
beq .8
|
||
|
||
.1 phx
|
||
lda #'-'
|
||
>SYSCALL PutChar
|
||
plx
|
||
bcs .9
|
||
|
||
dex
|
||
bne .1
|
||
|
||
.8 clc
|
||
.9 rts
|
||
*---------------------------------------
|
||
OUT.Print >SYSCALL PrintF
|
||
bcs OUT.Print.RTS
|
||
*---------------------------------------
|
||
OUT.PrintCR >PUSHW L.MSG.CRLF
|
||
>PUSHBI 0
|
||
>SYSCALL PrintF
|
||
|
||
OUT.PrintCR1 >DEC.G OUT.LineCnt
|
||
bne .8
|
||
|
||
lda #PAGE.LEN
|
||
sta (pData),y
|
||
|
||
.8
|
||
* clc
|
||
OUT.Print.RTS rts
|
||
*---------------------------------------
|
||
MAN
|
||
SAVE usr/src/bin/asm.s.out
|
||
LOAD usr/src/bin/asm.s
|
||
ASM
|