A2osX/BIN/ASM.S.OUT.txt

335 lines
4.8 KiB
Plaintext
Raw Normal View History

NEW
2019-09-02 06:09:28 +00:00
AUTO 3,1
*---------------------------------------
2019-03-25 07:04:40 +00:00
OUT.Init lda #PAGE.LEN
>STA.G OUT.LineCnt
2020-03-10 07:24:08 +00:00
clc
rts
*---------------------------------------
2020-03-09 06:58:48 +00:00
OUT.EmitByte phy
phx
tax
2020-03-09 06:58:48 +00:00
>LDA.G ASM.PASS
beq .1
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
>LDA.G ASM.DU.ON
bmi .1
2020-08-17 13:03:39 +00:00
2021-05-14 20:58:20 +00:00
>PUSHB.G DST.hREFNUM
2020-03-09 06:58:48 +00:00
txa
>PUSHA
2021-05-14 20:58:20 +00:00
phx
2020-03-09 06:58:48 +00:00
>SYSCALL FPutC
plx
2021-05-14 20:58:20 +00:00
bcs .9
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
.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
2020-02-26 16:34:13 +00:00
2020-03-09 06:58:48 +00:00
.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
2021-05-14 20:58:20 +00:00
bcs .9
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
ldy #OUT.Buf
lda #0
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
.4 inc
sta (pData),y
2020-02-26 16:34:13 +00:00
clc
2020-03-09 06:58:48 +00:00
adc #OUT.Buf
tay
txa
sta (pData),y
2020-08-17 13:03:39 +00:00
2019-03-26 15:22:48 +00:00
.8 clc
2020-02-26 16:34:13 +00:00
2021-05-14 20:58:20 +00:00
.9 plx
2020-03-09 06:58:48 +00:00
ply
2020-08-17 13:03:39 +00:00
rts
2019-03-26 15:22:48 +00:00
*---------------------------------------
2020-03-09 06:58:48 +00:00
OUT.PrintBuf jsr OUT.PrintLineOn
bcs OUT.PrintBufReset
2020-03-09 06:58:48 +00:00
>LDA.G ASM.LI.XON
bpl OUT.PrintBufReset
2020-02-24 13:33:28 +00:00
2020-03-09 06:58:48 +00:00
jsr OUT.PrintLineOutBuf
bcs OUT.PrintBuf.RTS
2020-02-26 16:34:13 +00:00
jsr OUT.PrintCR
2020-03-09 06:58:48 +00:00
bcs OUT.PrintBuf.RTS
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
OUT.PrintBufReset
>STZ.G OUT.Buf
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
ldx #4
ldy #ASM.PC
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
.2 lda (pData),y
pha
iny
dex
bne .2
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
ldx #4
ldy #OUT.PC+3
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
.3 pla
sta (pData),y
dey
dex
2020-03-09 06:58:48 +00:00
bne .3
2020-08-17 13:03:39 +00:00
2020-02-24 13:33:28 +00:00
.8 clc
2020-08-17 13:03:39 +00:00
OUT.PrintBuf.RTS
2020-03-09 06:58:48 +00:00
rts
*---------------------------------------
2020-08-17 13:03:39 +00:00
OUT.PrintLine jsr OUT.PrintLineOn
bcc OUT.PrintLine.1
clc
rts
2020-08-17 13:03:39 +00:00
OUT.PrintLine.1 jsr OUT.PrintLineOutBuf
2020-03-09 06:58:48 +00:00
bcs OUT.PrintBuf.RTS
2020-08-17 13:03:39 +00:00
2020-02-24 13:33:28 +00:00
>LDA.G SRC.Depth
2020-02-23 20:01:48 +00:00
2019-04-01 06:07:56 +00:00
.1 dec
2020-02-23 20:01:48 +00:00
beq .2
2019-04-01 06:07:56 +00:00
pha
2020-02-23 20:01:48 +00:00
lda #'>'
2020-03-09 06:58:48 +00:00
>SYSCALL PutChar
2019-04-01 06:07:56 +00:00
pla
bra .1
2020-08-17 13:03:39 +00:00
2020-02-23 20:01:48 +00:00
.2 >PUSHW L.MSG.LINENUM
>PUSHW.G SRC.LINENUM
2019-04-01 06:07:56 +00:00
>PUSHBI 2
2020-02-28 07:21:46 +00:00
>SYSCALL PrintF
2020-08-17 13:03:39 +00:00
2020-02-25 16:42:22 +00:00
>LDA.G MAC.CtxStackPtr
2020-08-17 13:03:39 +00:00
2019-04-01 06:07:56 +00:00
.3 dec
bmi .4
2020-08-17 13:03:39 +00:00
2019-04-01 06:07:56 +00:00
pha
2020-02-23 20:01:48 +00:00
lda #'>'
2020-03-09 06:58:48 +00:00
>SYSCALL PutChar
2019-04-01 06:07:56 +00:00
pla
bra .3
.4 >LDYA ZPLineBuf
2020-02-28 07:21:46 +00:00
>SYSCALL PutS
2020-02-25 16:42:22 +00:00
2019-04-01 06:07:56 +00:00
jmp OUT.PrintCR1
*---------------------------------------
OUT.PrintLineOutBuf
>LDA.G OUT.bEquate
2020-02-23 20:01:48 +00:00
bne OUT.PrintLineEQU
2020-08-17 13:03:39 +00:00
>LDA.G OUT.Buf
2020-02-23 20:01:48 +00:00
pha
asl
tax
2020-02-23 20:01:48 +00:00
>PUSHB L.MSG.OUT0+1,x
>PUSHB L.MSG.OUT0,x
2020-08-17 13:03:39 +00:00
2020-02-23 20:01:48 +00:00
ldy #OUT.PC+1
>PUSHB (pData),y
dey
>PUSHB (pData),y
2020-08-17 13:03:39 +00:00
2020-02-23 20:01:48 +00:00
pla
beq .2
tax
ldy #OUT.Buf
2020-08-17 13:03:39 +00:00
2019-01-28 07:44:37 +00:00
pha
2020-08-17 13:03:39 +00:00
2020-02-23 20:01:48 +00:00
.1 iny
>PUSHB (pData),y
dex
bne .1
pla
2020-08-17 13:03:39 +00:00
2020-02-23 20:01:48 +00:00
.2 inc
2019-01-28 07:44:37 +00:00
inc
>PUSHA Byte Count+2 for PC
2020-02-28 07:21:46 +00:00
>SYSCALL PrintF
2020-08-17 13:03:39 +00:00
rts
2019-03-21 16:37:02 +00:00
*---------------------------------------
2020-02-23 20:01:48 +00:00
OUT.PrintLineEQU
2019-03-21 16:37:02 +00:00
lda SRC.ACC.SIZE
2020-02-23 20:01:48 +00:00
asl
2019-03-21 16:37:02 +00:00
tax
2020-02-23 20:01:48 +00:00
>PUSHB L.MSG.EQU0+1,x
>PUSHB L.MSG.EQU0,x
lda SRC.ACC.SIZE
beq .2
2020-08-17 13:03:39 +00:00
2020-02-23 20:01:48 +00:00
tay
2020-08-17 13:03:39 +00:00
2020-02-23 20:01:48 +00:00
.1 dey
>PUSHB SRC.ACC,y
tya
bne .1
2020-08-17 13:03:39 +00:00
lda SRC.ACC.SIZE
2019-03-21 16:37:02 +00:00
.2 >PUSHA Byte Count
2020-02-28 07:21:46 +00:00
>SYSCALL PrintF
rts
2018-11-26 21:52:49 +00:00
*---------------------------------------
2020-03-09 06:58:48 +00:00
OUT.PrintLineOn
>LDA.G bListAll
bmi .8
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
>LDA.G ASM.LI.ON
bpl .9
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
>LDA.G ASM.MA.ON MACRO Mode ?
2020-08-17 13:03:39 +00:00
bmi .1
2020-03-09 06:58:48 +00:00
2020-08-17 13:03:39 +00:00
>LDA.G MAC.CtxID within MACRO ?
beq .11
.1 >LDA.G ASM.LI.MON
2020-03-09 06:58:48 +00:00
bpl .9
clc
rts
2018-03-19 16:48:41 +00:00
2020-08-17 13:03:39 +00:00
.11 >LDA.G ASM.DO.StackPtr within a DO/ELSE ?
2020-03-09 06:58:48 +00:00
beq .2
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
clc
adc #ASM.DO.Stack-1
tay
2020-08-17 13:03:39 +00:00
lda (pData),y TRUE ?
bne .8 yes, print always
>LDA.G ASM.LI.CON FALSE, check CON flag...
2020-03-09 06:58:48 +00:00
bpl .9
clc
rts
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
.2
2020-03-09 06:58:48 +00:00
.8 clc
rts
2020-02-26 16:34:13 +00:00
2020-03-09 06:58:48 +00:00
.9 sec
2020-08-17 13:03:39 +00:00
OUT.PrintLineOnRTS
2020-03-09 06:58:48 +00:00
rts
*---------------------------------------
OUT.PrintLineErr
sta DIR.Byte Save Error code
2020-02-26 16:34:13 +00:00
2020-03-09 06:58:48 +00:00
jsr OUT.PrintLine.1
2020-08-17 13:03:39 +00:00
bcs OUT.PrintLineOnRTS
>PUSHW L.MSG.ERROR
2020-03-09 06:58:48 +00:00
>PUSHB DIR.Byte
>PUSHBI 1
>SYSCALL PrintF
2020-02-26 16:34:13 +00:00
2020-03-09 06:58:48 +00:00
lda ZPLinePtr
sec
sbc ZPLineBuf
jsr OUT.PrintLineErrDashA
2020-02-27 16:46:40 +00:00
2020-03-09 06:58:48 +00:00
>LDA.G SRC.Depth
dec
jsr OUT.PrintLineErrDashA
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
>LDA.G MAC.CtxStackPtr
jsr OUT.PrintLineErrDashA
2020-02-26 16:34:13 +00:00
2020-03-09 06:58:48 +00:00
lda #'^'
>SYSCALL PutChar
2020-08-17 13:03:39 +00:00
bcs OUT.PrintLineOnRTS
2020-02-26 16:34:13 +00:00
2020-03-09 06:58:48 +00:00
jsr OUT.PrintCR
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
>PUSHW L.MSG.PASS
>LDA.G ASM.PASS
inc
>PUSHA
>PUSHBI 1
jsr OUT.Print
2020-08-17 13:03:39 +00:00
jmp OUT.PrintCR
2020-03-09 06:58:48 +00:00
*---------------------------------------
OUT.PrintLineErrDashA
tax
beq .8
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
.1 phx
lda #'-'
>SYSCALL PutChar
plx
bcs .9
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
dex
bne .1
2020-08-17 13:03:39 +00:00
2020-03-09 06:58:48 +00:00
.8 clc
.9 rts
*---------------------------------------
OUT.PrintWarn1 jsr OUT.PrintLine.1
>LDYA L.MSG.WARN1
>SYSCALL PutS
rts
*---------------------------------------
2020-03-09 06:58:48 +00:00
OUT.Print >SYSCALL PrintF
bcs OUT.Print.RTS
*---------------------------------------
2020-02-23 20:01:48 +00:00
OUT.PrintCR >PUSHW L.MSG.CRLF
>PUSHBI 0
2020-02-28 07:21:46 +00:00
>SYSCALL PrintF
2020-02-23 20:01:48 +00:00
2019-04-01 06:07:56 +00:00
OUT.PrintCR1 >DEC.G OUT.LineCnt
2019-03-26 15:22:48 +00:00
bne .8
2020-02-23 20:01:48 +00:00
2019-03-26 15:22:48 +00:00
lda #PAGE.LEN
sta (pData),y
2020-03-09 06:58:48 +00:00
2020-08-17 13:03:39 +00:00
.8
* clc
2020-03-09 06:58:48 +00:00
OUT.Print.RTS rts
2019-03-26 15:22:48 +00:00
*---------------------------------------
MAN
2020-08-17 13:03:39 +00:00
SAVE usr/src/bin/asm.s.out
LOAD usr/src/bin/asm.s
ASM