A2osX/BIN/SH.S.EXP.txt

268 lines
4.5 KiB
Plaintext
Raw Normal View History

2019-02-01 16:32:29 +00:00
NEW
PREFIX
AUTO 4,1
.LIST OFF
*--------------------------------------
2019-02-12 16:47:34 +00:00
EXP.GET jsr CORE.ArgV.Next
2019-02-11 06:58:33 +00:00
bne .1
2019-02-12 16:47:34 +00:00
>LDYA ZPArgVBufPrev no op, return text value
2019-02-11 06:58:33 +00:00
clc
rts
2019-02-12 16:47:34 +00:00
.1 >LDYA ZPArgVBufPrev
2019-02-11 06:58:33 +00:00
>SYSCALL AToL
bcs .99
>PULLL.G M32.ACC
.2 >LDYA L.EXP.OP.MATH + - .... ?
2019-02-11 16:44:56 +00:00
jsr CORE.LookupArgVBuf
2019-02-11 06:58:33 +00:00
bcs .9
txa
>STA.G CORE.Operator
jsr M32.ACC2ARG
jsr CORE.ArgV.Next get next argument in ACC
beq .9
>LDYA ZPArgVBufPtr
>SYSCALL AToL
bcs .9
>PULLL.G M32.ACC
jsr EXP.GET.OP
.99 bcs .9
jsr CORE.ArgV.Next another op ?
bne .2
.8 >PUSHL.G M32.ACC
>PUSHBI 4
>PUSHW L.M32.Printf
>LEA.G M32.BUF
>SYSCALL sprintf
bcs .9
>LEA.G M32.Buf
rts
2019-02-12 16:47:34 +00:00
.9 lda #E.ESYN
2019-02-11 06:58:33 +00:00
sec
rts
EXP.GET.OP >LDA.G CORE.Operator
tax
jmp (J.EXP.OP.MATH,x)
*--------------------------------------
EXP.TEST lda (ZPArgVBufPtr)
2019-02-01 16:32:29 +00:00
beq .9
>LDYA L.EXP.BEGIN
2019-02-11 16:44:56 +00:00
jsr CORE.LookupArgVBuf
2019-02-01 16:32:29 +00:00
bcs .9
cpx #4 [ or ![
bcs .9
dex
dex 1 or $ff
txa
and #$80 true or false
>ORA.G CORE.Test
sta (pData),y
2019-02-11 06:58:33 +00:00
jsr CORE.ArgV.Next
2019-02-01 16:32:29 +00:00
beq .9
2019-02-12 16:47:34 +00:00
2019-02-14 14:51:24 +00:00
>LDYA L.EXP.OP.UNARY -d -e -f -n -z ?
2019-02-11 16:44:56 +00:00
jsr CORE.LookupArgVBuf
2019-02-01 16:32:29 +00:00
bcs .1
txa
>STA.G CORE.Operator
2019-02-11 06:58:33 +00:00
jsr EXP.TEST.UNARY
2019-02-01 16:32:29 +00:00
bcs .9
>EOR.G CORE.Test
sta (pData),y
2019-02-14 14:51:24 +00:00
lda (ZPArgVBufPtr)
bra .80 go check ]
2019-02-11 06:58:33 +00:00
2019-02-01 16:32:29 +00:00
.9 lda #E.ESYN
sec
.99 rts
2019-02-12 16:47:34 +00:00
.1 jsr CORE.ArgV.Next
2019-02-01 16:32:29 +00:00
beq .9
>LDYA L.EXP.OP.BINARY -eq -ne .... ?
2019-02-11 16:44:56 +00:00
jsr CORE.LookupArgVBuf
2019-02-01 16:32:29 +00:00
bcs .9
txa
>STA.G CORE.Operator
2019-02-11 06:58:33 +00:00
jsr EXP.TEST.BINARY
2019-02-01 16:32:29 +00:00
bcs .9
>EOR.G CORE.Test
sta (pData),y
2019-02-11 06:58:33 +00:00
.8 jsr CORE.ArgV.Next
2019-02-01 16:32:29 +00:00
beq .9
2019-02-14 14:51:24 +00:00
.80 cmp #']'
2019-02-01 16:32:29 +00:00
bne .9
ldy #1
2019-02-11 06:58:33 +00:00
lda (ZPArgVBufPtr),y
2019-02-01 16:32:29 +00:00
bne .9
clc
rts
*--------------------------------------
2019-02-11 06:58:33 +00:00
EXP.TEST.UNARY jsr CORE.ArgV.Next
2019-02-14 14:51:24 +00:00
beq EXP.OP.UNARY.ESYN we need one arg or ]
2019-02-01 16:32:29 +00:00
>LDA.G CORE.Operator
tax
jmp (J.EXP.OP.UNARY,x)
2019-02-14 14:51:24 +00:00
EXP.OP.UNARY.ESYN
lda #E.ESYN
2019-02-01 16:32:29 +00:00
sec
rts
EXP.OP.UNARY.D jsr EXP.OP.UNARY.DEF.7
bcs EXP.OP.UNARY.DEF.9
>LDA.G StatBuf+S.STAT.P.TYPE
cmp #S.FI.T.DIR
bne EXP.OP.UNARY.DEF.9
bra EXP.OP.UNARY.DEF.8
EXP.OP.UNARY.E jsr EXP.OP.UNARY.DEF.7
bcs EXP.OP.UNARY.DEF.9
bra EXP.OP.UNARY.DEF.8 DIR or FILE exist
EXP.OP.UNARY.F jsr EXP.OP.UNARY.DEF.7
bcs EXP.OP.UNARY.DEF.9
>LDA.G StatBuf+S.STAT.P.TYPE
cmp #S.FI.T.DIR
beq EXP.OP.UNARY.DEF.9
bra EXP.OP.UNARY.DEF.8
EXP.OP.UNARY.DEF.7
>PUSHEA.G StatBuf
2019-02-11 06:58:33 +00:00
>LDYA ZPArgVBufPtr
2019-02-01 16:32:29 +00:00
>SYSCALL STAT
2019-02-14 14:51:24 +00:00
php
jsr CORE.ArgV.Next
plp
2019-02-01 16:32:29 +00:00
rts
EXP.OP.UNARY.DEF.8
lda #$80 true
clc
rts
EXP.OP.UNARY.DEF.9
lda #0 false
clc
rts
*--------------------------------------
2019-02-14 14:51:24 +00:00
EXP.OP.UNARY.N lda (ZPArgVBufPtr) [ -N ] ?
cmp #']'
beq EXP.OP.UNARY.DEF.9 FALSE
jsr CORE.ArgV.Next
beq EXP.OP.UNARY.ESYN
bra EXP.OP.UNARY.DEF.8 arg is not empty TRUE
EXP.OP.UNARY.Z lda (ZPArgVBufPtr) [ -Z ] ?
cmp #']'
beq EXP.OP.UNARY.DEF.8 TRUE
jsr CORE.ArgV.Next
beq EXP.OP.UNARY.ESYN
bra EXP.OP.UNARY.DEF.9 FALSE
*--------------------------------------
2019-02-11 06:58:33 +00:00
EXP.TEST.BINARY >LDA.G CORE.Operator
2019-02-01 16:32:29 +00:00
beq .1 =
cmp #2 !=
2019-02-11 06:58:33 +00:00
bne EXP.TEST.BINARY.NUM
2019-02-01 16:32:29 +00:00
lda #$80
>STA.G CORE.Operator
2019-02-21 22:03:08 +00:00
.1 >LDYA ZPArgVBufPrev
>STYA ZPPtr1
jsr CORE.ArgV.Next
2019-02-11 06:58:33 +00:00
beq .9
2019-02-21 22:03:08 +00:00
>PUSHW ZPPtr1
2019-02-11 06:58:33 +00:00
>LDYA ZPArgVBufPtr
2019-02-01 16:32:29 +00:00
>SYSCALL strcmp
2019-02-21 22:03:08 +00:00
2019-02-01 16:32:29 +00:00
ror CS if !=
and #$80
eor #$80
>EOR.G CORE.Operator
clc
rts
.9 lda #E.ESYN
sec
rts
*--------------------------------------
2019-02-11 06:58:33 +00:00
EXP.TEST.BINARY.NUM
2019-02-14 14:51:24 +00:00
>LDYA ZPArgVBufPrev
2019-02-01 16:32:29 +00:00
>SYSCALL AToL
bcs .9
>PULLL.G M32.ACC
2019-02-14 14:51:24 +00:00
jsr CORE.ArgV.Next
beq .9
2019-02-11 06:58:33 +00:00
>LDYA ZPArgVBufPtr
2019-02-01 16:32:29 +00:00
>SYSCALL AToL
bcs .9
>PULLL.G M32.ARG
jsr M32.Cmp
pha
>LDA.G CORE.Operator
lsr
tax
pla
and EXP.OP.BINARY.BITS,x
beq .80
lda #$80 true
clc
rts
.80 lda #0 false
clc
rts
.9 lda #E.ESYN
sec
rts
*--------------------------------------
MAN
2019-02-08 16:13:43 +00:00
SAVE USR/SRC/BIN/SH.S.EXP
LOAD USR/SRC/BIN/SH.S
2019-02-01 16:32:29 +00:00
ASM