2021-12-02 21:28:26 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Input:
|
|
|
|
|
* ZPLineBufPtr, Y,A = Expected type/qual
|
|
|
|
|
* Output:
|
|
|
|
|
* CS, A = EC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
* CC, Y,A = type/qual
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Eval00 lda #0
|
2022-01-30 21:47:08 +00:00
|
|
|
|
tay
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Eval ldx ZPPtr1 local : returned T/Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
phx
|
|
|
|
|
ldx ZPPtr1+1
|
|
|
|
|
phx
|
|
|
|
|
|
|
|
|
|
ldx ZPPtr2 local : expected T/Q
|
2021-12-02 21:28:26 +00:00
|
|
|
|
phx
|
|
|
|
|
ldx ZPPtr2+1
|
|
|
|
|
phx
|
|
|
|
|
|
|
|
|
|
ldx ZPPtr3 local : BOP
|
|
|
|
|
phx
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldx ZPPtr3+1 local : PREOP
|
2021-12-02 21:28:26 +00:00
|
|
|
|
phx
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
>STYA ZPPtr2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
stz ZPPtr1
|
|
|
|
|
stz ZPPtr1+1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda #$ff no previous OP
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sta ZPPtr3+1 no PREOPS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
pha
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.10 jsr CC.GetCharNB
|
|
|
|
|
bcs .19
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
cmp #'('
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bne .20
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip (
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .19
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
>LDYA L.CC.TYPEQUAL
|
|
|
|
|
jsr CC.LookupID
|
|
|
|
|
bcs .12
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.Cast
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .19
|
|
|
|
|
|
|
|
|
|
bra .20
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.12 >LDYA ZPPtr2 expected T/Q
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.Eval
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .19
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr2 update T/Q
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .19
|
|
|
|
|
|
|
|
|
|
cmp #')'
|
|
|
|
|
bne .19
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip )
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcc .31
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.19 jmp EXP.Eval.ESYN
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.20 >LDYA L.CC.PREOPS
|
|
|
|
|
jsr CC.LookupOP
|
|
|
|
|
stx ZPPtr3+1
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .29
|
|
|
|
|
|
|
|
|
|
jsr CC.IsLetter define, f() or Var ?
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .22
|
|
|
|
|
|
|
|
|
|
jsr CC.GetDefine
|
|
|
|
|
bcc .10
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.Lookup
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .22
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldy #SYM.Q
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
and #SYM.Q.FUNC
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bne .21
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.GetVar Check T/Q & Get value on stack
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .29
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.LookupFree
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bra .30
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.21 >LDYA ZPPtr2 get expected T/Q
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr F.CallRetV
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .29
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr2 store real T/Q
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.LookupFree
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bra .30
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.22 jsr CC.IsDigit10 number ?
|
|
|
|
|
bcs .24
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldy ZPPtr2 T
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bne .23
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldy #SYM.T.SINT
|
2021-12-02 21:28:26 +00:00
|
|
|
|
sty ZPPtr2
|
2022-09-04 20:12:49 +00:00
|
|
|
|
stz ZPPtr2+1 Q
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.23 jsr EXP.GetNum
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .29
|
|
|
|
|
|
|
|
|
|
bra .30
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.24 cmp #'''
|
|
|
|
|
bne .25
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.GetChar
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .29
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bra .30
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.25 cmp #'"' String literal
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bne EXP.Eval.ESYN
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.AddConstCharP
|
|
|
|
|
.29 bcs EXP.Eval.Err
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.30 jsr CC.GetCharNB
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcs EXP.Eval.ESYN
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.31 jsr CC.IsEndArg , ; ) ? :
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcc EXP.Eval.End
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
jsr CC.IsOPChar
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcs EXP.Eval.ESYN
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
>LDYA L.CC.BOPS we are at V1 op1 V2 op2...
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr CC.LookupOP
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcs EXP.Eval.ESYN
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
stx ZPPtr3 save OP(n)
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
.33 plx get OP(n-1)
|
|
|
|
|
bmi .38 $ff....
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
cpx ZPPtr3
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcc .38 OP(n) has precedence, on stack : V1,V2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr2 OP(n-1) has precedence...
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.BOPS compute V(n-1) <OP(n-1)> V(n)
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcc .33
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcs EXP.Eval.Err
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
.38 phx push back OP(n-1)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
lda ZPPtr3 get OP(n)
|
|
|
|
|
pha push OP(n) on stack
|
|
|
|
|
|
|
|
|
|
jmp .10 go check for next token
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Eval.End plx any OP on stack ?
|
|
|
|
|
bmi EXP.Eval.Exit
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr2 Var Type
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.BOPS
|
|
|
|
|
bcc EXP.Eval.End
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bra EXP.Eval.Err
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Eval.ESYN lda #E.ESYN
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Eval.Err plx
|
|
|
|
|
bpl EXP.Eval.Err
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
sec
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bra EXP.Eval.ExitErr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Eval.Exit lda ZPPtr1+1
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy ZPPtr1
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
>LDYA ZPPtr2 Type/Qual
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
.1 and #$FC ignore SYM.Q.FUNC+SYM.Q.FASTCALL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
clc
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Eval.ExitErr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
plx
|
2021-12-02 21:28:26 +00:00
|
|
|
|
stx ZPPtr3+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr3
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr2+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr2
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr1+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPPtr1
|
2022-06-22 06:26:44 +00:00
|
|
|
|
|
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Cast jsr TYPE.GetTQInYA
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>STYA ZPPtr1
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cmp #')'
|
|
|
|
|
bne .9
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip )
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
* Y,A = Type/Qual, X = OP
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.BOPS bit #SYM.Q.PPPOINTER
|
2022-08-20 14:37:37 +00:00
|
|
|
|
beq .10
|
|
|
|
|
|
|
|
|
|
ldy #SYM.T.UINT
|
|
|
|
|
bra .3
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.10 cpy #SYM.T.UINT
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .3
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
cpy #SYM.T.UCHAR
|
2021-12-02 21:28:26 +00:00
|
|
|
|
beq .1
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
cpy #SYM.T.SCHAR
|
2021-12-02 21:28:26 +00:00
|
|
|
|
beq .2
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.1 >LDYA L.PCC.bBOPS,x
|
|
|
|
|
jmp CODE.EmitPCC
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.2 >LDYA L.PCC.bBOPS,x
|
|
|
|
|
jmp CODE.EmitPCC
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.3 txa
|
|
|
|
|
clc
|
2022-01-30 21:47:08 +00:00
|
|
|
|
adc CC.Type2FPU-SYM.T.UINT,y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
tax
|
|
|
|
|
jsr CODE.FPUCALL
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-18 05:56:59 +00:00
|
|
|
|
EXP.GetIntegral jsr CC.GetCharNB
|
|
|
|
|
cmp #'''
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
jsr CC.GetNextCharEsc
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
jsr CC.GetNextChar
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cmp #'''
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
jsr CORE.GetNCharNB skip '
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2022-10-18 05:56:59 +00:00
|
|
|
|
lda #0 Y,A = integral
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 jsr CC.IsDigit10
|
|
|
|
|
bcc EXP.IntConst
|
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
* sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.IntConst >PUSHW ZPLineBufPtr
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>PUSHWI ZPLineBufPtr
|
|
|
|
|
>PUSHBI 10
|
|
|
|
|
>SYSCALL StrToUL
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
|
|
|
|
|
inc pStack
|
2022-10-18 05:56:59 +00:00
|
|
|
|
inc pStack Y,A = integral
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.GetNum cpy #SYM.T.FLOAT
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
beq .11
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.90 lda #E.TMISMATCH
|
2021-12-02 21:28:26 +00:00
|
|
|
|
* sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.11 >PUSHW ZPLineBufPtr
|
|
|
|
|
>PUSHWI ZPLineBufPtr
|
|
|
|
|
>SYSCALL StrToF
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* bcs .99
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #4
|
|
|
|
|
|
|
|
|
|
.10 lda (pStack),y
|
|
|
|
|
jsr CODE.PUSHI
|
|
|
|
|
dey
|
|
|
|
|
bpl .10
|
|
|
|
|
|
|
|
|
|
>POP 5
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 >PUSHW ZPLineBufPtr
|
|
|
|
|
>PUSHWI ZPLineBufPtr
|
|
|
|
|
>PUSHBI 10
|
|
|
|
|
|
|
|
|
|
lda CC.TYPESIGN-1,y
|
|
|
|
|
bmi .2
|
|
|
|
|
|
|
|
|
|
>SYSCALL StrToUL
|
|
|
|
|
bra .3
|
|
|
|
|
|
|
|
|
|
.2 >SYSCALL StrToL
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.3 bcs .99
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldy #1 anticipate 2 bytes if *
|
|
|
|
|
lda ZPPtr2+1
|
|
|
|
|
and #SYM.Q.PPPOINTER
|
|
|
|
|
bne .5
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldx ZPPtr2
|
|
|
|
|
lda CC.TYPESIZE-1,x
|
|
|
|
|
|
|
|
|
|
dec
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.5 lda (pStack),y
|
|
|
|
|
jsr CODE.PUSHI
|
|
|
|
|
dey
|
|
|
|
|
bpl .5
|
|
|
|
|
|
|
|
|
|
>POP 4
|
|
|
|
|
* clc
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.GetChar ldy ZPPtr2+1
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bne .9
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda ZPPtr2
|
|
|
|
|
cmp #SYM.T.UCHAR
|
|
|
|
|
beq .1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cmp #SYM.T.SCHAR
|
|
|
|
|
bne .9
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.1 jsr CC.GetNextCharEsc
|
|
|
|
|
bcs .9
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr CODE.PUSHI
|
|
|
|
|
bcs .99
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr CC.GetNextChar
|
|
|
|
|
bcs .9
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cmp #'''
|
|
|
|
|
bne .9
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip '
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.AddConstCharP
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda ZPCCConst
|
|
|
|
|
ldx ZPCCConst+1
|
2023-01-27 13:32:13 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr CODE.LDAXI
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.PushIAddr
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CODE.DSSelect
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
.1 jsr CC.GetNextCharEsc
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
bvs .2 ESCaped
|
|
|
|
|
|
|
|
|
|
cmp #C.CR
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
cmp #'"'
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
.2 jsr CODE.EmitData
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
bra .1
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.3 jsr CORE.GetNCharNBNL Skip "
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .8
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2023-01-27 13:32:13 +00:00
|
|
|
|
cmp #'\'
|
|
|
|
|
beq .3
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cmp #'"'
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
.8 lda #0
|
|
|
|
|
jsr CODE.EmitData
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jmp CODE.CSSelect
|
|
|
|
|
|
|
|
|
|
.9 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-01-30 21:47:08 +00:00
|
|
|
|
* ZPPtr2 = expected T/Q
|
|
|
|
|
* ZPPtr3+1 = PREOPS
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.GetVar stz ExpState
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.POSTOPS var++, var[0]... ?
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .99
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldx ZPPtr3+1 preop &, * ...
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.PREOPS
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .99
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda ExpState
|
|
|
|
|
bmi .8 VonStack
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
asl
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bmi .7 AinPTR
|
|
|
|
|
|
|
|
|
|
asl
|
|
|
|
|
bmi .6 AonStack
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.GetAddr2
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
bra .7
|
|
|
|
|
|
|
|
|
|
.6 >LDYA L.PCC.PopAddr2
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .99
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.7 jsr EXP.PushValue
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.8 jmp SYM.LookupCheckTQ
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* POSTOPS
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.POSTOPS >LDYA L.CC.POSTOPS
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CC.LookupOP
|
|
|
|
|
bcs .8
|
|
|
|
|
|
|
|
|
|
jmp (J.CC.POSTOPS,x)
|
|
|
|
|
|
|
|
|
|
.8 clc
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
2022-08-20 14:37:37 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.postinc lda ExpState
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bit #ExpState.AinPTR
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.GetAddr2
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #ExpState.AinPTR
|
|
|
|
|
tsb ExpState
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.1 ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
and #SYM.Q.AAARRAY+SYM.Q.PPPOINTER
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
lda (ZPLookupSymPtr) #SYM.T
|
|
|
|
|
cmp #SYM.T.FLOAT
|
|
|
|
|
bcs .98
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda CC.TYPESIZE-1,y
|
|
|
|
|
lsr
|
|
|
|
|
bcc .2
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.Inc1
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.2 lsr
|
|
|
|
|
bcc .4
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.Inc2
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
|
|
|
|
.4 >LDYA L.PCC.Inc4
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.8
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
.98 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.postdec lda ExpState
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bit #ExpState.AinPTR
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.GetAddr2
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #ExpState.AinPTR
|
|
|
|
|
tsb ExpState
|
|
|
|
|
|
|
|
|
|
.1 ldy #SYM.Q
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
and #SYM.Q.AAARRAY+SYM.Q.PPPOINTER
|
|
|
|
|
bne .8
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr) #SYM.T
|
|
|
|
|
cmp #SYM.T.FLOAT
|
|
|
|
|
bcs .98
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
tay
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda CC.TYPESIZE-1,y
|
|
|
|
|
lsr
|
|
|
|
|
bcc .2
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.Dec1
|
|
|
|
|
jmp CODE.EmitPCC
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.2 lsr
|
|
|
|
|
bcc .4
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.Dec2
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
|
|
|
|
.4 >LDYA L.PCC.Dec4
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jmp CODE.EmitPCC
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
.8
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.98 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Idx ldy #SYM.Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bit #SYM.Q.AAARRAY
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bne EXP.array
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
|
|
|
|
and #SYM.Q.PPPOINTER
|
|
|
|
|
cmp #SYM.Q.POINTER
|
|
|
|
|
bne .98
|
|
|
|
|
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
eor #SYM.Q.POINTER+SYM.Q.ARRAY
|
|
|
|
|
sta (ZPLookupSymPtr),y convert from *type to type[]
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.GetAddr2
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.PushDeref2
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.array.getIdx ...int16 on stack...
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr EXP.GetSymSizeOfInAX
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cmp #1
|
|
|
|
|
bne .1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cpx #0
|
|
|
|
|
beq .2 sizeof=1, no MUL required
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.1 jsr CODE.PUSHAXI ...sizeof on stack...
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldx #FPU.wMUL
|
|
|
|
|
jsr CODE.FPUCALL ...sizeof*int16...
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
.2 ldx #FPU.wAdd
|
|
|
|
|
jsr CODE.FPUCALL ...add to base address
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .97
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
cmp #']'
|
|
|
|
|
bne .97
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip ']'
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
|
|
|
|
lda #ExpState.AonStack
|
|
|
|
|
sta ExpState
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.97 lda #E.ESYN
|
|
|
|
|
sec
|
2022-09-17 11:35:52 +00:00
|
|
|
|
rts
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
|
|
|
|
.98 lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.array ldy #SYM.Def
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
iny
|
|
|
|
|
ora (ZPLookupSymPtr),y
|
|
|
|
|
beq .1
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* jsr CODE.DEBUG
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.PushAddr array[int]...
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcc .2
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
rts
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.1 jsr EXP.GetAddr2 array[]...it is a *
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .9
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.PushDeref2
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .9
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.2 jsr EXP.array.getIdx ...int16 on stack...
|
2022-01-30 21:47:08 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr EXP.GetSymSizeOfInAX
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.PUSHAXI ...sizeof on stack...
|
|
|
|
|
bcs .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldx #FPU.wMUL
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.FPUCALL ...sizeof*int16...
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldx #FPU.wAdd
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.FPUCALL ...add to base address
|
|
|
|
|
bcs .9
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.3 jsr CORE.GetNCharNB skip ']'
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .98
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
cmp #'['
|
|
|
|
|
bne .8
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip '['
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .98
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
and #SYM.Q.AAARRAY
|
|
|
|
|
.39 beq .99
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.array.getIdx ...int16 on stack...
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .9
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Def+3
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
jsr CODE.PUSHAXI [][SIZE] on stack
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldx #FPU.wMUL
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.FPUCALL [][SIZE] * int16 on stack
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr EXP.GetSymSizeOfInAX
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.PUSHAXI ...sizeof on stack...
|
|
|
|
|
bcs .9
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldx #FPU.wMUL
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.FPUCALL ...sizeof*int16...
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldx #FPU.wAdd
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.FPUCALL ...add to base address
|
|
|
|
|
bcs .9
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CORE.GetNCharNB skip ']'
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .98
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
* TODO : [][][]
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.8 lda #ExpState.AonStack
|
|
|
|
|
sta ExpState
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.98 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.99 lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.array.getIdx
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.T.SINT
|
|
|
|
|
lda #0
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.Eval
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
cmp #']'
|
|
|
|
|
bne .98
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #SYM.Q.ARRAY
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sta (ZPLookupSymPtr),y
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.98 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.SU lda (ZPLookupSymPtr)
|
2022-09-17 11:35:52 +00:00
|
|
|
|
cmp #SYM.T.SU
|
|
|
|
|
bne .97
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
and #SYM.Q.PPPOINTER
|
|
|
|
|
bne .97
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
jsr CC.IsLetter
|
|
|
|
|
bcs .98
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.SU.GetF
|
2022-09-17 11:35:52 +00:00
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
jsr CC.SkipX
|
|
|
|
|
|
|
|
|
|
lda (ZPLookupSymPtr),y SU.F.T
|
|
|
|
|
sta (ZPLookupSymPtr) SYM.T
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPLookupSymPtr),y SU.F.Q
|
|
|
|
|
phy
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
sta (ZPLookupSymPtr),y
|
|
|
|
|
ply
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPLookupSymPtr),y SU.F.O
|
|
|
|
|
phy
|
|
|
|
|
ldy #SYM.Addr
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPLookupSymPtr),y
|
|
|
|
|
sta (ZPLookupSymPtr),y
|
|
|
|
|
|
|
|
|
|
ply
|
|
|
|
|
iny
|
2022-10-07 19:21:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y SU.F.O+1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
ldy #SYM.Addr+1
|
|
|
|
|
adc (ZPLookupSymPtr),y
|
|
|
|
|
sta (ZPLookupSymPtr),y
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.97 lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.98 lda #E.ESYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2022-08-20 14:37:37 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.pSU lda #E.ESYN
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.SU.GetF jsr CC.GetIDLen
|
2022-09-17 11:35:52 +00:00
|
|
|
|
tya
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Def
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPLookupSymPtr),y
|
|
|
|
|
beq .98
|
|
|
|
|
|
|
|
|
|
phy SU.F.T
|
|
|
|
|
tya
|
|
|
|
|
clc
|
|
|
|
|
adc #SU.F.Name
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
cmp (ZPLookupSymPtr),y
|
|
|
|
|
bne .7
|
|
|
|
|
|
|
|
|
|
phy SU.F.Name
|
|
|
|
|
phx SU.F.NameLen
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
clc
|
|
|
|
|
adc ZPLookupSymPtr
|
|
|
|
|
sta ZPLookupPtr
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
adc ZPLookupSymPtr+1
|
|
|
|
|
sta ZPLookupPtr+1
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPLineBufPtr),y
|
|
|
|
|
iny
|
|
|
|
|
cmp (ZPLookupPtr),y
|
|
|
|
|
bne .6
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
plx NameLen
|
|
|
|
|
pla SU.F.Name
|
|
|
|
|
|
|
|
|
|
ply SU.F.T
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.6 plx
|
|
|
|
|
ply
|
|
|
|
|
|
|
|
|
|
.7 pla
|
|
|
|
|
sec
|
|
|
|
|
adc (ZPLookupSymPtr),y
|
|
|
|
|
adc #SU.F.Name
|
|
|
|
|
tay
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.98 lda #E.NOKEY
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-08-20 14:37:37 +00:00
|
|
|
|
* PREOPS
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.PREOPS bmi .8
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jmp (J.CC.PREOPS,x)
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Ref ldy #SYM.Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
clc
|
2022-08-20 14:37:37 +00:00
|
|
|
|
adc #SYM.Q.POINTER
|
|
|
|
|
bcs .9 more than ***
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
* and #%11001111
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sta (ZPLookupSymPtr),y
|
|
|
|
|
|
|
|
|
|
bit ExpState
|
|
|
|
|
bvs .8
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.PushAddr
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
.8 lda #ExpState.VonStack
|
|
|
|
|
sta ExpState
|
|
|
|
|
|
|
|
|
|
* clc Addr on stack
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.9 lda #E.TMISMATCH
|
|
|
|
|
* sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Deref ldy #SYM.Q
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
bit #SYM.Q.PPPOINTER
|
|
|
|
|
beq .9
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
sec
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sbc #SYM.Q.POINTER
|
|
|
|
|
sta (ZPLookupSymPtr),y
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.GetAddr2
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.Deref2
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .99
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda #ExpState.AinPTR
|
|
|
|
|
sta ExpState
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.Abs
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.negate
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.lnot
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.bnot
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.preinc
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.predec
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.PushAddr ldy #SYM.SC
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
beq .1 SYM.SC.STATIC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
* LOCAL
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.PushLAddrH
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.Addr
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
eor #$FF
|
|
|
|
|
inc
|
|
|
|
|
jsr CODE.LDAI
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.PushLAddrL
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
* GLOBAL
|
|
|
|
|
|
|
|
|
|
.1 ldy #SYM.Addr+1
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
tax
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
dey
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.LDAXI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
and #SYM.Q.CONST
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.PushIAddr
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.2 >LDYA L.PCC.PushUAddr
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.GetAddr1 ldy #SYM.SC
|
2022-08-20 14:37:37 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
beq .1 SYM.SC.STATIC
|
|
|
|
|
* LOCAL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldy #SYM.Addr
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
eor #$FF
|
|
|
|
|
inc
|
|
|
|
|
jsr CODE.LDAI
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.GetLAddr1
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
* GLOBAL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.1 ldy #SYM.Addr+1
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
tax
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
dey
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CODE.LDAXI
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
and #SYM.Q.CONST
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
>LDYA L.PCC.GetIAddr1
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
|
|
|
|
|
.2 >LDYA L.PCC.GetUAddr1
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
.9 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
EXP.GetAddr2 ldy #SYM.SC
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
beq .1 SYM.SC.STATIC
|
|
|
|
|
* LOCAL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ldy #SYM.Addr
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
eor #$FF
|
|
|
|
|
inc
|
|
|
|
|
jsr CODE.LDAI
|
|
|
|
|
bcs .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.GetLAddr2
|
|
|
|
|
jmp CODE.EmitPCC
|
|
|
|
|
* GLOBAL
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.1 ldy #SYM.Addr+1
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
|
|
|
|
|
jsr CODE.LDAXI
|
|
|
|
|
bcs .9
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
ldy #SYM.Q
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
2022-08-20 14:37:37 +00:00
|
|
|
|
and #SYM.Q.CONST
|
|
|
|
|
beq .2
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
>LDYA L.PCC.GetIAddr2
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.2 >LDYA L.PCC.GetUAddr2
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.9 rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-23 16:50:50 +00:00
|
|
|
|
EXP.PushValue jsr EXP.GetSymSizeOfInAX
|
2022-08-20 14:37:37 +00:00
|
|
|
|
tay
|
|
|
|
|
dey
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bne .1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>LDYA L.PCC.PushValue1
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.1 cpy #1
|
2022-09-17 11:35:52 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>LDYA L.PCC.PushValue2
|
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.2 jsr CODE.LDYI
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>LDYA L.PCC.PushValueY
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jmp CODE.EmitPCC
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-12-23 16:50:50 +00:00
|
|
|
|
* out : A,X = size
|
2022-08-20 14:37:37 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-23 16:50:50 +00:00
|
|
|
|
EXP.GetSymSizeOfInAX
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
pha
|
|
|
|
|
lda (ZPLookupSymPtr) SYM.T
|
2022-01-30 21:47:08 +00:00
|
|
|
|
tay
|
2022-08-20 14:37:37 +00:00
|
|
|
|
pla
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
EXP.GetYASizeOfInAX
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bit #SYM.Q.PPPOINTER+SYM.Q.AAARRAY
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda CC.TYPESIZE-1,y
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 lda #2 pointer
|
|
|
|
|
ldx #0
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
sec +1 for hMem Storage
|
2022-01-30 21:47:08 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.exp
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|