A2osX/BIN/ASM.S.DIR.txt

574 lines
9.3 KiB
Plaintext
Raw Normal View History

NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
2015-10-04 20:55:51 +00:00
*---------------------------------------
DIR.Reset lda #$80
ldy #ASM.LI.ON
sta (pData),y
lda #0
2015-12-04 16:33:33 +00:00
ldy #ASM.LI.CON
sta (pData),y
ldy #ASM.LI.MON
sta (pData),y
2015-12-04 16:33:33 +00:00
ldy #ASM.LI.XON
sta (pData),y
rts
*---------------------------------------
2015-10-04 20:55:51 +00:00
DIR.AC clc
rts
*---------------------------------------
2018-02-01 07:16:35 +00:00
DIR.AT sec
.HS 90 BCC
2015-10-04 20:55:51 +00:00
*---------------------------------------
2018-02-01 07:16:35 +00:00
DIR.AS clc
lda #0
ror
sta DIR.Byte Save b7 of last char in string
jsr SRC.GetNextChar
bcs .9
cmp #'-'
bne .1
2018-02-01 07:16:35 +00:00
lda #$40 save b7 status of ALL chars
tsb DIR.Byte
jsr SRC.GetNextChar
bcs .9
.1 sta DIR.Word Save delimiter....
2018-02-01 07:16:35 +00:00
sta DIR.Word+1 Save also in prev char..
.2 jsr SRC.GetNextChar
2018-02-01 07:16:35 +00:00
bcs .8
cmp DIR.Word delimiter ?
beq .8
ldx DIR.Word+1 Get prev char
sta DIR.Word+1 replace it with new
txa
cmp DIR.Word is it the starting delimiter
beq .2 yes, skip
2018-02-01 07:16:35 +00:00
bit DIR.Byte
bvc .3
ora #$80
.3 jsr OUT.EmitByte no, emit prev char
bcc .2
2018-02-01 07:16:35 +00:00
.9 lda #ERR.SYNTAX.ERROR
sec
2015-10-04 20:55:51 +00:00
rts
2018-02-01 07:16:35 +00:00
.8 lda DIR.Word+1 Get prev char
cmp DIR.Word someone typed .AS "" ?
beq .88
2018-02-01 07:16:35 +00:00
bit DIR.Byte
bpl .81
eor #$80
2018-02-01 07:16:35 +00:00
.81 jmp OUT.EmitByte
.88 clc
2018-02-01 07:16:35 +00:00
rts
2015-10-04 20:55:51 +00:00
*---------------------------------------
2018-02-01 07:16:35 +00:00
DIR.AZ jsr DIR.AS
bcs .9
lda #0
jmp OUT.EmitByte
.9 rts
2015-10-04 20:55:51 +00:00
*---------------------------------------
DIR.BS jsr SRC.GetNextCharNB
2018-01-23 07:31:16 +00:00
bcs .98
2018-01-15 06:50:44 +00:00
jsr EXP.Eval
2015-12-04 16:33:33 +00:00
bcs .9
lda SRC.ACC+3
ora SRC.ACC+2
bne .99
lda SRC.ACC
eor #$ff
2018-02-01 07:16:35 +00:00
sta DIR.Word
2015-12-04 16:33:33 +00:00
lda SRC.ACC+1
eor #$ff
2018-02-01 07:16:35 +00:00
sta DIR.Word+1
2015-12-04 16:33:33 +00:00
stz DIR.Byte
2018-01-11 16:34:09 +00:00
jsr SRC.GetNextChar
2018-01-23 07:31:16 +00:00
bcs .1
2015-12-04 16:33:33 +00:00
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
2018-02-01 07:16:35 +00:00
.1 inc DIR.Word
bne .2
2018-02-01 07:16:35 +00:00
inc DIR.Word+1
2015-12-04 16:33:33 +00:00
beq .8
.2 lda DIR.Byte
jsr OUT.EmitByte
bcc .1
2015-12-04 16:33:33 +00:00
rts
.8 clc
.9 rts
.99 lda #ERR.RANGE
sec
rts
2018-01-12 16:05:04 +00:00
2015-12-04 16:33:33 +00:00
.98 lda #ERR.SYNTAX.ERROR
sec
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
DIR.DA jsr SRC.GetNextCharNB
bcs .98
.1 jsr EXP.Eval
bcs .9
ldx SRC.ACC.SIZE
bne .10
2018-03-19 16:48:41 +00:00
ldx #2
2018-03-19 16:48:41 +00:00
.10 ldy #0
.2 lda SRC.ACC,y
jsr OUT.EmitByte
2018-03-19 16:48:41 +00:00
bcs .9
iny
dex
2018-03-19 16:48:41 +00:00
bne .2
.3 jsr SRC.GetNextChar
bcs .8
cmp #' '
beq .8
cmp #','
bne .98
jsr SRC.GetNextChar
bcc .1
.98 lda #ERR.SYNTAX.ERROR
clc
.9 rts
.8 clc
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
2018-02-05 07:09:38 +00:00
DIR.DO >LDA.G ASM.DO.StackPtr
2015-12-04 16:33:33 +00:00
inc
cmp #SRC.DO.MAXDEPTH
bcs .98
jsr SRC.GetNextCharNB
bcs .99
2015-12-04 16:33:33 +00:00
jsr EXP.Eval
bcs .99
2018-02-05 07:09:38 +00:00
>INC.G ASM.DO.StackPtr
2015-12-04 16:33:33 +00:00
* clc ok from bcs .99
2018-02-05 07:09:38 +00:00
adc #ASM.DO.Stack-1
2015-12-04 16:33:33 +00:00
tay
lda SRC.ACC
ora SRC.ACC+1
ora SRC.ACC+2
2018-02-05 07:09:38 +00:00
ora SRC.ACC+3
beq .1
lda #$ff
2015-12-04 16:33:33 +00:00
2018-02-05 07:09:38 +00:00
.1 sta (pData),y
2015-12-04 16:33:33 +00:00
lda #$FF
>STA.G ASM.DO.ON
2015-12-04 16:33:33 +00:00
clc
2015-10-04 20:55:51 +00:00
rts
2015-12-04 16:33:33 +00:00
.98 lda #ERR.TOO.MANY.DO
sec
.99 rts
2015-10-04 20:55:51 +00:00
*---------------------------------------
DIR.DU clc
rts
*---------------------------------------
DIR.ED clc
rts
*---------------------------------------
2018-02-05 07:09:38 +00:00
DIR.EL >LDA.G ASM.DO.StackPtr
beq .9
clc
adc #ASM.DO.Stack-1
tay
lda (pData),y
eor #$ff
sta (pData),y
clc
rts
.9 lda #ERR.ELSE.WITHOUT.DO
sec
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
2018-01-29 16:48:07 +00:00
DIR.EM lda #ERR.MACRO.INV.DEF
2015-10-06 16:14:48 +00:00
sec
rts
*---------------------------------------
2015-10-04 20:55:51 +00:00
DIR.EN clc
rts
*---------------------------------------
2015-12-04 16:33:33 +00:00
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
2015-12-04 16:33:33 +00:00
sec
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
DIR.EQ >LDA.G SYM.bGlobal
beq .99
jsr SRC.GetNextCharNB
2018-01-23 07:31:16 +00:00
bcs .99
2018-01-12 16:05:04 +00:00
jsr EXP.Eval
2015-10-28 16:55:12 +00:00
bcs .9
2015-11-20 16:31:14 +00:00
jsr SYM.UpdateGlobalAcc
bcs .9
2015-10-28 16:55:12 +00:00
lda #1
>STA.G OUT.bEquate
2015-10-28 16:55:12 +00:00
clc
2018-01-12 16:05:04 +00:00
rts
.99 lda #ERR.SYNTAX.ERROR
sec
2015-10-28 16:55:12 +00:00
.9 rts
2015-10-04 20:55:51 +00:00
*---------------------------------------
2018-02-05 07:09:38 +00:00
DIR.FI ldy #ASM.DO.StackPtr
2015-12-04 16:33:33 +00:00
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
2015-12-04 16:33:33 +00:00
sec
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
DIR.HS jsr SRC.GetNextCharNB
bcs .99
jsr SRC.IsDigit16
bcs .99
.1 >STA.G DIR.Byte
jsr SRC.GetNextChar
bcc .2
jmp OUT.EmitByte
.2 jsr SRC.IsDigit16
bcc .3
cmp #','
beq .22
cmp #'.'
bne .99
.22 >LDA.G DIR.Byte
jsr OUT.EmitByte
bcc .5
rts
.3 pha
>LDA.G DIR.Byte
asl
asl
asl
asl
>STA.G DIR.Byte
pla
>ORA.G DIR.Byte
.4 jsr OUT.EmitByte
bcs .9
jsr SRC.GetNextChar
bcs .8
cmp #' '
beq .8
jsr SRC.IsDigit16
bcc .1
cmp #','
beq .5
cmp #'.'
bne .99
.5 jsr SRC.GetNextChar
bcs .99
jsr SRC.IsDigit16
bcc .1
.99 lda #ERR.SYNTAX.ERROR
sec
.9 rts
.8 clc
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
2018-01-15 06:50:44 +00:00
DIR.IN jsr SRC.GetNextCharNB
2018-01-23 07:31:16 +00:00
bcs .9
2015-10-06 16:14:48 +00:00
2018-01-11 16:34:09 +00:00
>LDYA ZPLinePtr
>SYSCALL RealPath.YA
2015-10-06 16:14:48 +00:00
2016-08-17 06:25:58 +00:00
phx
2015-11-20 16:31:14 +00:00
2018-01-11 16:34:09 +00:00
jsr FIO.OpenFile
2015-11-20 16:31:14 +00:00
plx
php
pha
txa
>SYSCALL FreeMem.A
2015-11-20 16:31:14 +00:00
pla
plp
2015-10-06 16:14:48 +00:00
rts
.9 lda #ERR.SYNTAX.ERROR
2015-11-20 16:31:14 +00:00
sec
2015-10-06 16:14:48 +00:00
rts
*---------------------------------------
DIR.LI jsr SRC.GetNextChar
bcs .9
2018-01-11 16:34:09 +00:00
>LDYA L.T.LI
2015-10-06 16:14:48 +00:00
jsr SRC.GetKeyword
bcs .9
jsr .7
jsr SRC.GetChar
bcs .8
cmp #','
beq DIR.LI
cmp #' '
beq .8
.9 lda #ERR.SYNTAX.ERROR
sec
rts
.7 jmp (J.LI,x)
.8 clc
rts
DIR.LI.ON ldy #ASM.LI.ON
sec
bra DIR.LI.APPLY
2015-10-06 16:14:48 +00:00
DIR.LI.OFF ldy #ASM.LI.ON
clc
bra DIR.LI.APPLY
2015-10-06 16:14:48 +00:00
DIR.LI.CON ldy #ASM.LI.CON
sec
bra DIR.LI.APPLY
2015-10-06 16:14:48 +00:00
DIR.LI.COFF ldy #ASM.LI.CON
clc
bra DIR.LI.APPLY
DIR.LI.MON ldy #ASM.LI.MON
2015-10-06 16:14:48 +00:00
sec
bra DIR.LI.APPLY
DIR.LI.MOFF ldy #ASM.LI.MON
2015-10-06 16:14:48 +00:00
clc
bra DIR.LI.APPLY
DIR.LI.XON ldy #ASM.LI.XON
2015-10-06 16:14:48 +00:00
sec
bra DIR.LI.APPLY
DIR.LI.XOFF ldy #ASM.LI.XON
2015-10-06 16:14:48 +00:00
clc
DIR.LI.APPLY lda #0
ror
2015-11-20 16:31:14 +00:00
2015-10-06 16:14:48 +00:00
sta (pData),y
2018-01-11 16:34:09 +00:00
rts
2015-10-06 16:14:48 +00:00
*---------------------------------------
2018-01-29 16:48:07 +00:00
DIR.MA >LDA.G MAC.bAdd
bmi .9
2015-10-28 16:55:12 +00:00
2018-01-29 16:48:07 +00:00
>LDA.G ASM.PASS If Pass#2, ignore
2015-10-28 16:55:12 +00:00
bne .8
2018-01-29 16:48:07 +00:00
jsr SRC.GetNextCharNB
beq DIR.OP.SYNERR
2015-10-28 16:55:12 +00:00
jsr MAC.New
2015-10-06 16:14:48 +00:00
2018-01-29 16:48:07 +00:00
.8 lda #$ff
>STA.G MAC.bAdd
2015-10-06 16:14:48 +00:00
clc
rts
2018-01-29 16:48:07 +00:00
.9 lda #ERR.MACRO.INV.DEF
2015-10-06 16:14:48 +00:00
sec
2018-01-29 16:48:07 +00:00
rts
2015-10-04 20:55:51 +00:00
*---------------------------------------
2018-01-11 16:34:09 +00:00
DIR.OP jsr SRC.GetNextCharNB
bcs DIR.OP.SYNERR
2015-10-21 16:24:11 +00:00
2018-01-11 16:34:09 +00:00
>LDYA ZPLinePtr
2015-12-04 16:33:33 +00:00
jmp FIO.LOAD.ASM.T
2015-10-21 16:24:11 +00:00
2018-01-11 16:34:09 +00:00
DIR.OP.SYNERR lda #ERR.SYNTAX.ERROR
2015-10-21 16:24:11 +00:00
sec
2015-10-04 20:55:51 +00:00
rts
*---------------------------------------
2018-01-11 16:34:09 +00:00
DIR.OR jsr SRC.GetNextCharNB
2018-01-23 07:31:16 +00:00
bcs DIR.OP.SYNERR
2018-01-11 16:34:09 +00:00
jsr EXP.Eval
2015-10-28 16:55:12 +00:00
bcs .9
ldy #ASM.PC
ldx #0
.1 lda SRC.ACC,x
sta (pData),y
inx
iny
cpx #4
bne .1
clc
.9 rts
2015-10-04 20:55:51 +00:00
*---------------------------------------
DIR.PG clc
rts
*---------------------------------------
2015-12-04 16:33:33 +00:00
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
2015-12-04 16:33:33 +00:00
sec
2015-10-04 20:55:51 +00:00
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
2015-10-04 20:55:51 +00:00
ASM