A2osX/BIN/ASM.S.DIR.txt
2018-01-29 16:48:07 +00:00

383 lines
6.4 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
PREFIX /A2OSX.BUILD
AUTO 4,1
*---------------------------------------
DIR.Init lda #$80
ldy #ASM.LI.ON
sta (pData),y
lda #0
ldy #ASM.LI.CON
sta (pData),y
ldy #ASM.LI.XON
sta (pData),y
rts
*---------------------------------------
DIR.AC clc
rts
*---------------------------------------
DIR.AS clc
rts
*---------------------------------------
DIR.AT clc
rts
*---------------------------------------
DIR.AZ clc
rts
*---------------------------------------
DIR.BS jsr SRC.GetNextCharNB
bcs .98
jsr EXP.Eval
bcs .9
lda SRC.ACC+3
ora SRC.ACC+2
bne .99
lda SRC.ACC
sta DIR.Counter
lda SRC.ACC+1
bmi .99
sta DIR.Counter+1
stz DIR.Byte
jsr SRC.GetNextChar
bcs .1
cmp #' '
beq .1
cmp #','
bne .98
jsr EXP.Eval
bcs .9
lda SRC.ACC+3
ora SRC.ACC+2
ora SRC.ACC+1
bne .99
lda SRC.ACC
sta DIR.Byte
.1 ldy #ASM.PC
lda (pData),y
clc
adc DIR.Counter
sta (pData),y
iny
lda (pData),y
adc DIR.Counter+1
sta (pData),y
.2 lda DIR.Counter
bne .3
lda DIR.Counter+1
beq .8
dec DIR.Counter+1
.3 dec DIR.Counter
lda DIR.Byte
jsr FIO.EmitByte
bcc .2
rts
.8 clc
.9 rts
.99 lda #ERR.RANGE
sec
rts
.98 lda #ERR.SYNTAX.ERROR
sec
rts
*---------------------------------------
DIR.DA clc
rts
*---------------------------------------
DIR.DO ldy #ASM.DO.Count
lda (pData),y
inc
cmp #SRC.DO.MAXDEPTH
bcs .98
jsr EXP.Eval
bcs .99
ldy #ASM.DO.Count
lda (pData),y
inc
sta (pData),y
* clc ok from bcs .99
adc #ASM.DOELSE.Flag-1
tay
lda SRC.ACC
ora SRC.ACC+1
ora SRC.ACC+2
ora SRC.ACC+3 if
sta (pData),y
lda #$FF
ldy #ASM.DO.ON
sta (pData),y
clc
rts
.98 lda #ERR.TOO.MANY.DO
sec
.99 rts
*---------------------------------------
DIR.DU clc
rts
*---------------------------------------
DIR.ED clc
rts
*---------------------------------------
DIR.EL clc
rts
*---------------------------------------
DIR.EM lda #ERR.MACRO.INV.DEF
sec
rts
*---------------------------------------
DIR.EN clc
rts
*---------------------------------------
DIR.EP ldy #ASM.PH.ON
lda (pData),y
bpl .9
lda #0
sta (pData),y
ldy #ASM.PC.PH+3
ldx #3
.1 lda (pData),y
pha
dey
dex
bpl .1
ldy #ASM.PC
ldx #3
.2 pla
sta (pData),y
iny
dex
bpl .2
clc
rts
.9 lda #ERR.INV.DIR
sec
rts
*---------------------------------------
DIR.EQ >LDA.G SYM.bGlobal
beq .99
jsr SRC.GetNextCharNB
bcs .99
jsr EXP.Eval
bcs .9
jsr SYM.UpdateGlobalAcc
bcs .9
clc
rts
.99 lda #ERR.SYNTAX.ERROR
sec
.9 rts
*---------------------------------------
DIR.FI ldy #ASM.DO.Count
lda (pData),y
beq .99
dec
sta (pData),y
bne .1
lda #$0
ldy #ASM.DO.ON
sta (pData),y
.1 clc
rts
.99 lda #ERR.INV.DIR
sec
rts
*---------------------------------------
DIR.HS clc
rts
*---------------------------------------
DIR.IN jsr SRC.GetNextCharNB
bcs .9
>LDYA ZPLinePtr
>SYSCALL RealPath.YA
phx
jsr FIO.OpenFile
plx
php
pha
txa
>SYSCALL FreeMem.A
pla
plp
rts
.9 lda #ERR.SYNTAX.ERROR
sec
rts
*---------------------------------------
DIR.LI jsr SRC.GetNextCharNB
bcs DIR.LI.9
>LDYA L.T.LI
jsr SRC.GetKeyword
bcs DIR.LI.9
jmp (J.LI,x)
DIR.LI.CON ldy #ASM.LI.CON
sec
bra DIR.LI.APPLY
DIR.LI.COFF ldy #ASM.LI.CON
clc
bra DIR.LI.APPLY
DIR.LI.XON ldy #ASM.LI.XON
sec
bra DIR.LI.APPLY
DIR.LI.XOFF ldy #ASM.LI.XON
clc
bra DIR.LI.APPLY
DIR.LI.ON ldy #ASM.LI.ON
sec
bra DIR.LI.APPLY
DIR.LI.OFF ldy #ASM.LI.ON
clc
DIR.LI.APPLY asl
sta (pData),y
clc
rts
DIR.LI.9 lda #ERR.SYNTAX.ERROR
sec
rts
*---------------------------------------
DIR.MA >LDA.G MAC.bAdd
bmi .9
>LDA.G ASM.PASS If Pass#2, ignore
bne .8
jsr SRC.GetNextCharNB
beq DIR.OP.SYNERR
jsr MAC.Clear
.8 lda #$ff
>STA.G MAC.bAdd
clc
rts
.9 lda #ERR.MACRO.INV.DEF
sec
rts
*---------------------------------------
DIR.OP jsr SRC.GetNextCharNB
beq DIR.OP.SYNERR
>LDYA ZPLinePtr
jmp FIO.LOAD.ASM.T
DIR.OP.SYNERR lda #ERR.SYNTAX.ERROR
sec
rts
*---------------------------------------
DIR.OR jsr SRC.GetNextCharNB
bcs DIR.OP.SYNERR
jsr EXP.Eval
bcs .9
ldy #ASM.PC
ldx #0
.1 lda SRC.ACC,x
sta (pData),y
inx
iny
cpx #4
bne .1
clc
.9 rts
*---------------------------------------
DIR.PG clc
rts
*---------------------------------------
DIR.PH ldy #ASM.PH.ON
lda (pData),y
bmi .9
lda #$80
sta (pData),y
ldy #ASM.PC+3
ldx #3
.1 lda (pData),y
pha
dey
dex
bpl .1
ldy #ASM.PC.PH
ldx #3
.2 pla
sta (pData),y
iny
dex
bpl .2
jmp DIR.OR
.9 lda #ERR.INV.DIR
sec
rts
*---------------------------------------
DIR.SE clc
rts
*---------------------------------------
DIR.TA clc
rts
*---------------------------------------
DIR.TF clc
rts
*---------------------------------------
DIR.TI clc
rts
*---------------------------------------
DIR.US clc
rts
*---------------------------------------
MAN
SAVE /A2OSX.BUILD/BIN/DEV/ASM.S.DIR
LOAD /A2OSX.BUILD/BIN/DEV/ASM.S
ASM