2022-01-30 22:47:08 +01:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
2022-02-06 18:14:18 +01:00
|
|
|
|
*--------------------------------------
|
2022-10-07 21:21:37 +02:00
|
|
|
|
STMT.Get jsr CC.GetCharNB
|
2022-08-20 16:37:37 +02:00
|
|
|
|
jsr CC.IsLetter
|
|
|
|
|
ldx #$ff
|
|
|
|
|
bcc .20
|
|
|
|
|
|
|
|
|
|
>LDYA L.CC.PREOPS ++var ?
|
|
|
|
|
jsr CC.LookupOP
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.20 stx StmtPreOp
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jsr SYM.Lookup var or func() ?
|
2022-08-20 16:37:37 +02:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
ldy #SYM.SC
|
2022-09-11 21:11:32 +02:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
cmp #SYM.SC.TYPEDEF
|
2022-10-07 21:21:37 +02:00
|
|
|
|
bne .60
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
jsr CORE.GetNCharNB
|
2022-09-11 21:11:32 +02:00
|
|
|
|
bcs .9
|
2022-10-07 21:21:37 +02:00
|
|
|
|
* >DEBUG
|
2022-09-11 21:11:32 +02:00
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
pha
|
|
|
|
|
lda (ZPLookupSymPtr)
|
|
|
|
|
pha
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jsr SYM.LookupFree
|
2022-09-11 21:11:32 +02:00
|
|
|
|
|
|
|
|
|
ply
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
sec Reset Buffer
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jmp DECL.YAC
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.60 ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
bit #SYM.Q.FUNC
|
|
|
|
|
beq .61
|
|
|
|
|
|
|
|
|
|
bit StmtPreOp
|
|
|
|
|
bpl .9 ++func ????????
|
|
|
|
|
|
|
|
|
|
jsr F.CallNoRetV func( ... );
|
|
|
|
|
bcs .99
|
2022-09-11 21:11:32 +02:00
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jmp SYM.LookupFree
|
|
|
|
|
*--------------------------------------
|
2022-09-11 21:11:32 +02:00
|
|
|
|
.61 jsr STMT.SetVar
|
2022-08-20 16:37:37 +02:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jmp SYM.LookupFree
|
2022-08-20 16:37:37 +02:00
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2022-09-04 22:12:49 +02:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
STMT.SetVar stz ExpState
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jsr EXP.POSTOPS var++, var[0]... ?
|
2022-09-04 22:12:49 +02:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldx StmtPreOp
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jsr EXP.PREOPS apply ++var, ....
|
2022-09-04 22:12:49 +02:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CC.GetCharNB
|
|
|
|
|
bcs .90
|
|
|
|
|
|
|
|
|
|
jsr CC.IsEndArg var++; or ++var; ?
|
|
|
|
|
bcc .8
|
|
|
|
|
|
|
|
|
|
jsr CC.LookupAOP var=, var+= ... ?
|
|
|
|
|
bcs .90
|
|
|
|
|
|
|
|
|
|
cpx #0 TOTO : all AOPS
|
|
|
|
|
bne *
|
|
|
|
|
|
|
|
|
|
lda ExpState
|
|
|
|
|
bmi .90 VonStack
|
|
|
|
|
|
|
|
|
|
asl
|
|
|
|
|
|
|
|
|
|
bmi .7 AinPTR
|
|
|
|
|
|
|
|
|
|
asl
|
|
|
|
|
bmi .6 AonStack
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jsr EXP.GetAddr1
|
2022-09-04 22:12:49 +02:00
|
|
|
|
bcc .7
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.6 >LDYA L.PCC.PopAddr1
|
|
|
|
|
jsr CODE.EmitPCC
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
.7 ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
pha
|
|
|
|
|
lda (ZPLookupSymPtr)
|
|
|
|
|
tay
|
|
|
|
|
pla get expected T/Q
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jsr EXP.Eval
|
2022-09-04 22:12:49 +02:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
jmp SYM.PopValue
|
2022-09-04 22:12:49 +02:00
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.90 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
|
2022-08-20 16:37:37 +02:00
|
|
|
|
*--------------------------------------
|
2022-01-30 22:47:08 +01:00
|
|
|
|
* X = KW.ID
|
|
|
|
|
*--------------------------------------
|
2022-08-20 16:37:37 +02:00
|
|
|
|
CC.STMT.CPStmt.NEW
|
|
|
|
|
>LDA.G CC.CPSID+1
|
2022-01-30 22:47:08 +01:00
|
|
|
|
jsr CC.Push
|
|
|
|
|
bcs .99
|
2022-08-20 16:37:37 +02:00
|
|
|
|
|
|
|
|
|
>LDA.G CC.CPSID
|
|
|
|
|
jsr CC.Push
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda LocalPtr Locals
|
|
|
|
|
jsr CC.Push
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-01-30 22:47:08 +01:00
|
|
|
|
lda #0 bState
|
|
|
|
|
jsr CC.Push
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
jsr CC.Push
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda #'}'
|
|
|
|
|
jmp CC.Push
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-08-20 16:37:37 +02:00
|
|
|
|
CC.STMT.Stmt.END
|
|
|
|
|
jsr CC.Get
|
|
|
|
|
bcs .8
|
|
|
|
|
|
|
|
|
|
cmp #'}'
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
cmp #';' must be ';' on stack....
|
2022-09-04 22:12:49 +02:00
|
|
|
|
bra CC.STMT.POP
|
2022-08-20 16:37:37 +02:00
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
|
|
|
|
|
CC.STMT.Stmt.RTS
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-01-30 22:47:08 +01:00
|
|
|
|
CC.STMT.CPStmt.END
|
2022-08-20 16:37:37 +02:00
|
|
|
|
jsr CC.Get
|
|
|
|
|
bcs CC.STMT.Stmt.RTS
|
2022-01-30 22:47:08 +01:00
|
|
|
|
|
|
|
|
|
cmp #'}' must be '}' on stack....
|
2022-09-04 22:12:49 +02:00
|
|
|
|
|
|
|
|
|
CC.STMT.POP bne .98
|
2022-01-30 22:47:08 +01:00
|
|
|
|
|
2022-08-20 16:37:37 +02:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPCCStack),y
|
2022-01-30 22:47:08 +01:00
|
|
|
|
|
2022-08-20 16:37:37 +02:00
|
|
|
|
jsr .7
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
bvs .1 DONT POP reused context (ELSE....)
|
|
|
|
|
|
|
|
|
|
lda CStackPtr
|
|
|
|
|
* clc
|
2022-09-04 22:12:49 +02:00
|
|
|
|
adc #7
|
2022-08-20 16:37:37 +02:00
|
|
|
|
sta CStackPtr
|
2022-01-30 22:47:08 +01:00
|
|
|
|
|
|
|
|
|
jsr CC.Pop Locals
|
|
|
|
|
sta LocalPtr
|
2022-08-20 16:37:37 +02:00
|
|
|
|
|
|
|
|
|
.1 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.7 tax
|
|
|
|
|
bmi .8
|
2022-01-30 22:47:08 +01:00
|
|
|
|
|
|
|
|
|
jmp (J.CC.KW.END,x)
|
|
|
|
|
|
2022-10-07 21:21:37 +02:00
|
|
|
|
.8 jmp F.Def.END
|
2022-01-30 22:47:08 +01:00
|
|
|
|
|
2022-08-20 16:37:37 +02:00
|
|
|
|
.98 lda #E.CSYN
|
2022-01-30 22:47:08 +01:00
|
|
|
|
sec
|
2022-08-20 16:37:37 +02:00
|
|
|
|
.99 rts
|
2022-06-12 22:42:22 +02:00
|
|
|
|
*--------------------------------------
|
2022-01-30 22:47:08 +01:00
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.stmt
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|