A2osX/BIN/ASM.S.CORE.txt
2025-01-19 17:12:51 +01:00

168 lines
2.6 KiB
Plaintext
Raw Permalink 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
*---------------------------------------
CORE.Pass2Init >STZ.G MAC.StkPtr
>STZ.G SYM.BufPtr
ldy #ASM.TotalLines
.1 sta (pData),y
iny
cpy #ASM.TotalLines+8
bcc .1
>INC.G ASM.PASS
*---------------------------------------
CORE.Pass1Init lda #$ff
>STA.G ASM.LI.ON
iny #ASM.LI.CON
sta (pData),y
iny #ASM.LI.MON
sta (pData),y
iny #ASM.LI.XON
sta (pData),y
lda #0
ldy #ASM.PC
.1 sta (pData),y
iny
cpy #ASM.PC.DU+4
bcc .1
jsr OUT.PrintPass
bcs .9
jsr OUT.PrintCR
bcs .9
>LDYA.G SRC.pFILENAME
jmp FIO.OpenFile
.9 rts
*---------------------------------------
CORE.ASMFile >SLEEP
ldy #S.PS.pStdIn
jsr A2osX.GetPSy
pha
iny
jsr A2osX.GetPSy
ply
>LIBC FEOF
bcs .9
tay
bne .1
>LIBC GetChar
bcs .9 I/O err
cmp #3 Ctrl-C
beq .9
cmp #19 Ctrl-S
bne .1
>LDA.G bPause
eor #$ff
sta (pData),y
bmi CORE.ASMFile
bpl .2
.1 >LDA.G bPause
bmi CORE.ASMFile
*---------------------------------------
.2 >LDYA ZPLineBuf
>STYA ZPLinePtr
.3 >LDA.G MAC.StkPtr
beq .5
jsr MAC.ReadLine
bcs .9
lda (ZPLineBuf)
bne .7
jsr MAC.Pop
bcc CORE.ASMFile
rts
*---------------------------------------
.5 jsr FIO.ReadLine
bcc .6
cmp #MLI.E.EOF End Of File?
sec
bne .9
jsr FIO.FileClose
bcs .9
>LDA.G SRC.Depth end of root file ?
bne CORE.ASMFile no continue back to previous file
jmp SYM.StoreGlobal Flush any pending SYM
*---------------------------------------
.6 jsr OUT.PrintBufReset
ldy #ASM.TotalLines
jsr CORE.IncDWordY
lda (ZPLineBuf)
beq .8
cmp #'*' Comment?
beq .8
cmp #';' Comment?
beq .8
ldy #ASM.CodeLines
jsr CORE.IncDWordY
*---------------------------------------
.7 jsr SRC.ParseLine
bcs .9
.8 jsr OUT.PrintLine
bcs .9
jmp CORE.ASMFile
.9 rts
*---------------------------------------
CORE.IncDWordY lda (pData),y
inc
sta (pData),y
bne .8
iny
lda (pData),y
inc
sta (pData),y
bne .8
iny
lda (pData),y
inc
sta (pData),y
bne .8
iny
lda (pData),y
inc
sta (pData),y
.8 rts
*---------------------------------------
MAN
SAVE usr/src/bin/asm.s.core
LOAD usr/src/bin/asm.s
ASM