A2osX/BIN/SH.S.EXP.txt

322 lines
5.8 KiB
Plaintext
Raw Normal View History

2019-02-01 16:32:29 +00:00
NEW
2019-06-02 08:58:46 +00:00
AUTO 3,1
2019-02-01 16:32:29 +00:00
.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-07-26 06:28:52 +00:00
>SYSCALL AToL To Int32 on stack
2019-07-07 20:48:57 +00:00
bcs .9
2019-02-11 06:58:33 +00:00
2019-04-01 06:07:56 +00:00
.2 >LDYA L.EXP.OP.MATH + - .... ?
2019-02-11 16:44:56 +00:00
jsr CORE.LookupArgVBuf
2019-07-07 20:48:57 +00:00
bcs .94
2019-02-11 06:58:33 +00:00
txa
>STA.G CORE.Operator
2019-07-26 06:28:52 +00:00
jsr CORE.ArgV.Next get next argument
2019-07-07 20:48:57 +00:00
beq .94
2019-02-11 06:58:33 +00:00
>LDYA ZPArgVBufPtr
2019-07-26 06:28:52 +00:00
>SYSCALL AToL To Int32 on stack
2019-07-07 20:48:57 +00:00
bcs .94
2019-02-11 06:58:33 +00:00
2019-07-07 20:48:57 +00:00
jsr EXP.FPU.EXEC
2019-02-11 06:58:33 +00:00
jsr CORE.ArgV.Next another op ?
bne .2
2019-07-07 20:48:57 +00:00
.8 >PUSHBI 4 ACC on stack
2019-02-11 06:58:33 +00:00
>PUSHW L.M32.Printf
>LEA.G M32.BUF
>SYSCALL sprintf
bcs .9
2019-04-01 06:07:56 +00:00
>LEA.G M32.BUF
2019-02-11 06:58:33 +00:00
rts
2019-07-26 06:28:52 +00:00
.94 >POP 4
2019-07-07 20:48:57 +00:00
2019-02-12 16:47:34 +00:00
.9 lda #E.ESYN
2019-02-11 06:58:33 +00:00
sec
rts
2019-07-07 20:48:57 +00:00
EXP.FPU.EXEC >LDA.G CORE.Operator
tax
lda EXP.OP.MATH.FPU,x
2019-02-11 06:58:33 +00:00
tax
2019-07-07 20:48:57 +00:00
jmp A2osX.FpuCall
2019-02-11 06:58:33 +00:00
*--------------------------------------
EXP.TEST lda (ZPArgVBufPtr)
2019-02-01 16:32:29 +00:00
beq .9
2019-04-02 15:28:50 +00:00
2019-04-08 15:39:38 +00:00
lda #$80
>STA.G CORE.TestOp No Op
2019-04-01 15:24:01 +00:00
.10 >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
2019-04-08 15:39:38 +00:00
dex 0=[ or 1=![ , $ff or 0
2019-02-01 16:32:29 +00:00
txa
2019-04-08 20:42:18 +00:00
asl in C
php
>LDA.G CORE.Test get parent
asl discard true/false
plp get new
ror set ctx and parent
2019-04-08 15:39:38 +00:00
>STA.G CORE.Test
2019-02-01 16:32:29 +00:00
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-04-02 15:28:50 +00:00
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)
2019-04-08 15:39:38 +00:00
bra .8 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-04-08 15:39:38 +00:00
jsr CORE.ArgV.Next
2019-02-01 16:32:29 +00:00
beq .9
2019-04-08 15:39:38 +00:00
.8 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
2019-04-01 15:24:01 +00:00
jsr CORE.ArgV.Next
2019-04-08 15:39:38 +00:00
beq .80
2019-04-01 15:24:01 +00:00
>LDYA L.EXP.OP.LOGIC
jsr CORE.LookupArgVBuf
bcs .9
2019-04-08 15:39:38 +00:00
txa 0 = AND, 1 = OR
2019-04-01 15:24:01 +00:00
>STA.G CORE.TestOp
txa
2019-04-08 15:39:38 +00:00
beq .84
>lda.G CORE.Test OR : prev test is true, exit
bmi .88
bra .85
.84 >lda.G CORE.Test AND : prev test is false, exit
2019-04-01 15:24:01 +00:00
bpl .88
2019-04-08 15:39:38 +00:00
.85 >LDA.G CORE.Test
>STA.G CORE.TestArg
jsr CORE.ArgV.Next
2019-04-01 15:24:01 +00:00
beq .9
2019-04-08 15:39:38 +00:00
jmp .10
2019-04-01 15:24:01 +00:00
2019-04-08 15:39:38 +00:00
.80 >LDA.G CORE.TestOp
bne .88 NONE, or OR : exit with last result
2019-04-01 15:24:01 +00:00
2019-04-08 15:39:38 +00:00
>LDA.G CORE.TestArg AND : stop if false
>AND.G CORE.Test
>STA.G CORE.Test
2019-04-01 15:24:01 +00:00
.88 clc
2019-02-01 16:32:29 +00:00
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
2019-04-01 06:07:56 +00:00
asl
2019-02-01 16:32:29 +00:00
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
2019-04-02 15:28:50 +00:00
EXP.OP.UNARY.D jsr EXP.OP.UNARY.STAT
2019-02-01 16:32:29 +00:00
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
2019-04-02 15:28:50 +00:00
EXP.OP.UNARY.E jsr EXP.OP.UNARY.STAT
2019-02-01 16:32:29 +00:00
bcs EXP.OP.UNARY.DEF.9
bra EXP.OP.UNARY.DEF.8 DIR or FILE exist
2019-04-02 15:28:50 +00:00
EXP.OP.UNARY.F jsr EXP.OP.UNARY.STAT
2019-02-01 16:32:29 +00:00
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
2019-04-02 15:28:50 +00:00
EXP.OP.UNARY.STAT
2019-02-01 16:32:29 +00:00
>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 ] ?
2019-03-01 14:36:20 +00:00
2019-02-14 14:51:24 +00:00
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-04-02 15:28:50 +00:00
cmp #6 =, !=, <= <, >=, >
2019-03-11 15:43:33 +00:00
bcs EXP.TEST.BINARY.NUM
2019-02-01 16:32:29 +00:00
2019-03-01 14:36:20 +00:00
>LDYA ZPArgVBufPrev
2019-02-21 22:03:08 +00:00
>STYA ZPPtr1
jsr CORE.ArgV.Next
2019-03-11 15:43:33 +00:00
beq EXP.TEST.BINARY.ESYN
2019-02-11 06:58:33 +00:00
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-03-11 15:43:33 +00:00
bcs .1 CS if !=
2019-02-01 16:32:29 +00:00
2019-03-11 15:43:33 +00:00
lda #%010 010 str1 = str2
bra EXP.TEST.BINARY.END
.1 asl CS if <
bcs .2
lda #%100 010 str1 < str2
bra EXP.TEST.BINARY.END
.2 lda #%001 010 str1 > str2
bra EXP.TEST.BINARY.END
2019-07-25 06:13:56 +00:00
EXP.TEST.BINARY.ESYN4
>POP 4
2019-03-11 15:43:33 +00:00
EXP.TEST.BINARY.ESYN
lda #E.ESYN
2019-02-01 16:32:29 +00:00
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
2019-03-11 15:43:33 +00:00
bcs EXP.TEST.BINARY.ESYN
2019-07-25 06:13:56 +00:00
2019-02-14 14:51:24 +00:00
jsr CORE.ArgV.Next
2019-07-25 06:13:56 +00:00
beq EXP.TEST.BINARY.ESYN4
2019-02-14 14:51:24 +00:00
2019-02-11 06:58:33 +00:00
>LDYA ZPArgVBufPtr
2019-02-01 16:32:29 +00:00
>SYSCALL AToL
2019-07-25 06:13:56 +00:00
bcs EXP.TEST.BINARY.ESYN4
2019-02-01 16:32:29 +00:00
2019-07-25 06:13:56 +00:00
>FPU SUB32
2019-07-07 20:48:57 +00:00
2019-07-25 06:13:56 +00:00
>PULLL M32.ACC
2019-07-07 20:48:57 +00:00
2019-07-25 06:13:56 +00:00
lda M32.ACC+3
bmi .5 ACC < ARG
2019-07-07 20:48:57 +00:00
ora M32.ACC+2
2019-07-25 06:13:56 +00:00
ora M32.ACC+1
ora M32.ACC
2019-07-07 20:48:57 +00:00
bne .4
2019-03-11 15:43:33 +00:00
2019-07-07 20:48:57 +00:00
lda #%010 010 ACC = ARG
bra EXP.TEST.BINARY.END
.4 lda #%100 100 ACC > ARG
bra EXP.TEST.BINARY.END
.5 lda #%001 001 ACC < ARG
2019-03-11 15:43:33 +00:00
EXP.TEST.BINARY.END
2019-02-01 16:32:29 +00:00
pha
>LDA.G CORE.Operator
tax
pla
and EXP.OP.BINARY.BITS,x
beq .80
lda #$80 true
clc
rts
.80 lda #0 false
clc
2019-03-11 15:43:33 +00:00
rts
2019-02-01 16:32:29 +00:00
*--------------------------------------
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