2022-01-30 21:47:08 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
2022-02-06 17:14:18 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
STMT.Get jsr CC.GetCharNB
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CC.IsLetter
|
|
|
|
|
ldx #$ff
|
|
|
|
|
bcc .20
|
|
|
|
|
|
|
|
|
|
>LDYA L.CC.PREOPS ++var ?
|
|
|
|
|
jsr CC.LookupOP
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.20 stx StmtPreOp
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.Lookup var or func() ?
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
ldy #SYM.SC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
cmp #SYM.SC.TYPEDEF
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bne .60
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
jsr CORE.GetNCharNB
|
2022-09-11 19:11:32 +00:00
|
|
|
|
bcs .9
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
pha
|
|
|
|
|
lda (ZPLookupSymPtr)
|
|
|
|
|
pha
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr SYM.LookupFree
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-09-11 19:11:32 +00:00
|
|
|
|
ply
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
sec Reset Buffer
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jmp DECL.YAC
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.60 ldy #SYM.Q
|
|
|
|
|
lda (ZPLookupSymPtr),y
|
|
|
|
|
bit #SYM.Q.FUNC
|
|
|
|
|
beq .61
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bit StmtPreOp
|
|
|
|
|
bpl .9 ++func ????????
|
|
|
|
|
|
|
|
|
|
jsr F.CallNoRetV func( ... );
|
|
|
|
|
bcs .99
|
2022-09-11 19:11:32 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jmp SYM.LookupFree
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.61 jsr STMT.SetVar
|
2022-08-20 14:37:37 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jmp SYM.LookupFree
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
2022-09-04 20:12:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
STMT.SetVar stz ExpState
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.POSTOPS var++, var[0]... ?
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldx StmtPreOp
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr EXP.PREOPS apply ++var, ....
|
2022-09-04 20:12:49 +00: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 19:21:37 +00:00
|
|
|
|
jsr EXP.GetAddr1
|
2022-09-04 20:12:49 +00: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 19:21:37 +00:00
|
|
|
|
jsr EXP.Eval
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jmp SYM.PopValue
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.90 lda #E.CSYN
|
|
|
|
|
sec
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
|
2022-10-18 05:56:59 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-06 14:02:35 +00:00
|
|
|
|
STMT.Stmt.END ldy StmtPtr
|
2023-01-21 21:53:55 +00:00
|
|
|
|
beq STMT.End.8 Global context
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda (StmtStk),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
bmi STMT.End.8 local F context
|
2022-12-30 16:29:57 +00:00
|
|
|
|
* in an instruction ...
|
2023-01-06 14:02:35 +00:00
|
|
|
|
iny STMT.TERM
|
|
|
|
|
lda (StmtStk),y
|
2022-10-18 05:56:59 +00:00
|
|
|
|
cmp #'}'
|
2023-01-21 21:53:55 +00:00
|
|
|
|
beq STMT.End.8 in a STMT...
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
|
|
|
|
cmp #';' must be ';' on stack....
|
2023-01-21 21:53:55 +00:00
|
|
|
|
bne STMT.End.9
|
|
|
|
|
|
|
|
|
|
jsr STMT.End
|
|
|
|
|
bcc STMT.Stmt.END
|
|
|
|
|
|
|
|
|
|
rts
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2023-01-21 21:53:55 +00:00
|
|
|
|
STMT.End.9 lda #E.STACKERROR
|
2022-12-07 16:09:29 +00:00
|
|
|
|
sec
|
2022-10-18 05:56:59 +00:00
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2023-01-21 21:53:55 +00:00
|
|
|
|
STMT.End.8 clc
|
|
|
|
|
rts
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-06 14:02:35 +00:00
|
|
|
|
STMT.CPStmt.END ldy StmtPtr
|
2023-01-21 21:53:55 +00:00
|
|
|
|
beq STMT.End.9
|
2022-12-23 16:50:50 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda (StmtStk),y
|
2022-12-13 06:55:13 +00:00
|
|
|
|
bpl .1
|
2022-12-23 16:50:50 +00:00
|
|
|
|
|
2022-12-13 06:55:13 +00:00
|
|
|
|
jmp F.Def.END local F context
|
|
|
|
|
|
|
|
|
|
.1 iny
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda (StmtStk),y STMT.TERM
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
cmp #'}' must be '}' on stack....
|
2023-01-21 21:53:55 +00:00
|
|
|
|
bne STMT.End.9
|
2022-12-13 06:55:13 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-06 14:02:35 +00:00
|
|
|
|
STMT.End ldy StmtPtr STMT.KW
|
|
|
|
|
lda (StmtStk),y
|
2022-12-13 06:55:13 +00:00
|
|
|
|
tax
|
|
|
|
|
jmp (J.CC.KW.END,x)
|
|
|
|
|
*--------------------------------------
|
2022-12-30 16:29:57 +00:00
|
|
|
|
STMT.New00 lda #0
|
2023-01-06 14:02:35 +00:00
|
|
|
|
jsr CC.Push STMT.hMEM
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bcs STMT.New.RTS
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
jsr CC.Push STMT.MemPtr
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bcs STMT.New.RTS
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
STMT.New lda #';' STMT.TERM
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr CC.Push
|
|
|
|
|
bcs .99
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
>LDA.G CC.CmdSave STMT.KW
|
2022-10-18 05:56:59 +00:00
|
|
|
|
jmp CC.Push
|
|
|
|
|
|
|
|
|
|
.99
|
2022-12-30 16:29:57 +00:00
|
|
|
|
STMT.New.RTS rts
|
2022-10-18 05:56:59 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-30 16:29:57 +00:00
|
|
|
|
STMT.SetType jsr CORE.GetNCharNBNL
|
|
|
|
|
bcs STMT.SetType.9
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
|
|
|
|
ldx #';'
|
|
|
|
|
|
|
|
|
|
cmp #'{'
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bne STMT.SetType.1
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2023-01-21 21:53:55 +00:00
|
|
|
|
STMT.SetTypeCP jsr SCOPE.New
|
2022-12-30 16:29:57 +00:00
|
|
|
|
bcs STMT.New.RTS
|
2022-12-07 16:09:29 +00:00
|
|
|
|
|
2022-10-18 05:56:59 +00:00
|
|
|
|
ldx #'}'
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
STMT.SetType.1 txa
|
2023-01-06 14:02:35 +00:00
|
|
|
|
ldy StmtPtr
|
|
|
|
|
iny STMT.TERM
|
|
|
|
|
sta (StmtStk),y
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
clc
|
2022-10-18 05:56:59 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
STMT.SetType.9 lda #E.CSYN
|
2022-10-18 05:56:59 +00:00
|
|
|
|
sec
|
2022-12-30 16:29:57 +00:00
|
|
|
|
rts
|
2022-10-18 05:56:59 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-06 14:02:35 +00:00
|
|
|
|
STMT.Close lda StmtPtr
|
2022-12-23 16:50:50 +00:00
|
|
|
|
clc
|
2023-01-06 14:02:35 +00:00
|
|
|
|
adc #STMT.hMEM
|
2022-12-23 16:50:50 +00:00
|
|
|
|
tay
|
2023-01-06 14:02:35 +00:00
|
|
|
|
lda (StmtStk),y
|
|
|
|
|
beq .1
|
2022-12-23 16:50:50 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
.1 ldy StmtPtr STMT.KW
|
|
|
|
|
iny STMT.TERM
|
|
|
|
|
lda (StmtStk),y
|
|
|
|
|
cmp #'}'
|
|
|
|
|
bne .2
|
2022-12-23 16:50:50 +00:00
|
|
|
|
|
2023-01-22 14:38:20 +00:00
|
|
|
|
jsr SCOPE.Close {};
|
2022-12-23 16:50:50 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2023-01-06 14:02:35 +00:00
|
|
|
|
.2 lda StmtPtr
|
|
|
|
|
clc
|
|
|
|
|
adc #STMT
|
|
|
|
|
sta StmtPtr
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2022-01-30 21:47:08 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s.stmt
|
|
|
|
|
LOAD usr/src/bin/cc.s
|
|
|
|
|
ASM
|