A2osX/BIN/CC.S.STMT.txt

210 lines
3.1 KiB
Plaintext
Raw Normal View History

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