A2osX/BIN/ASM.S.OUT.txt

302 lines
4.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*---------------------------------------
OUT.Init lda #PAGE.LEN
>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.PrintLineOn
>LDA.G bListAll
bmi .8
>LDA.G ASM.LI.ON
bpl .9
>LDA.G ASM.MA.ON MACRO Mode ?
bpl .1
>LDA.G ASM.LI.MON
bpl .9
clc
rts
.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
clc
rts
.2
.8 clc
rts
.9 sec
rts
*---------------------------------------
OUT.PrintLineErr
sta DIR.Byte Save Error code
jsr OUT.PrintLine.1
bcs .9
.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 .9
jsr OUT.PrintCR
>PUSHW L.MSG.PASS
>LDA.G ASM.PASS
inc
>PUSHA
>PUSHBI 1
jsr OUT.Print
jmp OUT.PrintCR
.9 rts
*---------------------------------------
OUT.PrintLineErrDashA
tax
beq .8
.1 phx
lda #'-'
>SYSCALL PutChar
plx
bcs .9
dex
bne .1
.8 clc
.9 rts
*---------------------------------------
OUT.PrintLine jsr OUT.PrintLineOn
bcs OUT.Print.RTS
OUT.PrintLine.1 jsr OUT.PrintLineOutBuf
bcs OUT.Print.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.Print >SYSCALL PrintF
bcs OUT.Print.RTS
jmp OUT.PrintCR
OUT.Print.RTS rts
*---------------------------------------
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.EmitByte phy
phx
pha
>LDA.G ASM.PASS
beq .10
>LDA.G ASM.DU.ON
bmi .10
pla
pha
>PUSHA
>LDA.G DST.hREFNUM
>SYSCALL fputc
plx
bcs .99
phx
.10 >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 clc
.99 plx
ply
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
* lda #$80
* >STA.G bPause
.8 rts
*---------------------------------------
MAN
SAVE USR/SRC/BIN/ASM.S.OUT
LOAD USR/SRC/BIN/ASM.S
ASM