This commit is contained in:
burniouf 2022-12-07 17:09:29 +01:00
parent 9a7d20a7e1
commit 6a46b55ff8
5 changed files with 35 additions and 47 deletions

Binary file not shown.

View File

@ -91,9 +91,10 @@ F.Decl ldy #SYM.Q
*--------------------------------------
.7 cmp #'{'
bne .9
>DEBUG
*--------------------------------------
F.Def bit bInitCode
bmi .8
bmi .1
dec bInitCode
@ -101,13 +102,18 @@ F.Def bit bInitCode
jsr CODE.EmitByte Close INIT code
bcs .99
.8 >LDYA ZPCCCode f() Code starts HERE
.1 >LDYA ZPCCCode f() Code starts HERE
jsr SYM.SetAddrYA
jsr SYM.Update
bcs .99
lda #$ff
>STA.G CC.CmdSave
jsr STMT.NewCPS00
bcs .99
lda LocalPtr
jsr CODE.LDAI A = f() ARGS size
bcs .99
@ -212,7 +218,7 @@ F.Def.END >LDYA L.PCC.LEAVE
jsr SCOPE.Close
stz LocalPtr back to global
>DEBUG
* >DEBUG
clv pop context
clc
.9 rts

View File

@ -94,7 +94,7 @@ KW.ELSE.END lda #'X' define EXIT Label
clv pop context
.99 rts
*--------------------------------------
KW.WHILE jsr STMT.NewCPS00
KW.WHILE jsr SCOPE.New
bcs .99
lda #'C' define CONT Label
@ -128,8 +128,11 @@ KW.WHILE jsr STMT.NewCPS00
cmp #')'
bne .9
clc
rts
jmp STMT.SetCPSType
* jmp STMT.SetCPSType
.9 lda #E.CSYN
sec
@ -151,7 +154,9 @@ KW.WHILE.END >LDYA L.PCC.SLEEP
jsr SYM.NewLabelA
bcs .99
clv pop context
* clv pop context
bit .99
.99 rts
*--------------------------------------

View File

@ -123,38 +123,22 @@ STMT.SetVar stz ExpState
*--------------------------------------
STMT.Stmt.END ldy CStackPtr
beq .8
beq STMT.POP.8
iny CPS.TERM
lda (ZPCCStack),y
cmp #'}'
beq .8
beq STMT.POP.8
cmp #';' must be ';' on stack....
bra STMT.POP
.8 clc
beq STMT.POP
STMT.POP.9 lda #E.STACKERROR
sec
rts
*--------------------------------------
* X = KW.ID
*--------------------------------------
STMT.CPStmt.NEW lda LocalPtr Locals
jsr CC.Push
bcs .99
lda #0 bState
jsr CC.Push
bcs .99
lda #'}'
jsr CC.Push
bcs .99
txa
jmp CC.Push
.99 rts
STMT.POP.8 clc
rts
*--------------------------------------
STMT.CPStmt.END ldy CStackPtr
beq STMT.POP.9
@ -163,15 +147,14 @@ STMT.CPStmt.END ldy CStackPtr
lda (ZPCCStack),y
cmp #'}' must be '}' on stack....
bne STMT.POP.9
STMT.POP bne .9
dey CPS.KW
STMT.POP dey CPS.KW
lda (ZPCCStack),y
jsr STMT.CLOSE
jsr STMT.End
bcs .99
bvs .1 DONT POP reused context (ELSE....)
bvs .8 DONT POP reused context (ELSE....)
ldy #CPS.LOCAL
lda (ZPCCStack),y
@ -182,24 +165,15 @@ STMT.POP bne .9
adc #CPS
sta CStackPtr
.1 clc
.8 clc
.99 rts
.9
STMT.POP.9 lda #E.STACKERROR
sec
rts
*--------------------------------------
STMT.CLOSE tax
STMT.End tax
bmi .8
jmp (J.CC.KW.END,x)
.8 jmp F.Def.END
.98 lda #E.CSYN
sec
.99 rts
*--------------------------------------
STMT.NewCPS00 lda #0
jsr CC.Push no T/Q
@ -237,6 +211,9 @@ STMT.SetCPSType jsr CORE.GetNCharNBNL
jsr CORE.GetNCharNB skip '{'
bcs .99
jsr SCOPE.New
bcs .99
ldx #'}'
.1 txa

View File

@ -10,7 +10,7 @@ NEW
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
DBG_SYM .EQ 0
DBG_SYM .EQ 1
*--------------------------------------
FILES.MAX .EQ 4
LIBS.MAX .EQ 4