Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-02-21 08:35:49 +01:00
parent bc6eec2c22
commit b2a4faedb7
3 changed files with 43 additions and 32 deletions

Binary file not shown.

View File

@ -41,6 +41,9 @@ CSH.Init >SYSCALL SListNew
>STA.G CSH.StackPtr
sta (ZPCSHConst)
sta (ZPCSHStack)
>DEBUG
>DEC.G bTrace
>DEC.G bDebug
* clc
.9 rts
*--------------------------------------
@ -575,13 +578,13 @@ CSH.ExpEval ldx ZPPtr1
phx
ldx ZPPtr2 local : VarType
phx
ldx ZPPtr2+1 local : BOP1
ldx ZPPtr2+1 local : BOP
phx
sta ZPPtr2 local : expected type
.13 sec
ror ZPPtr2+1 Reset BOP1
lda #$ff
pha
.10 jsr CSH.GetCharNB
bcs .19
@ -607,9 +610,8 @@ CSH.ExpEval ldx ZPPtr1
bcs .19
jmp .12
.19 jmp .90
*--------------------------------------
.20 jsr CSH.IsLetter define, Fnc or Var ?
bcs .2
@ -629,7 +631,7 @@ CSH.ExpEval ldx ZPPtr1
.1 lda ZPPtr2 var type
jsr CSH.fCall X = function index
bcs .99
bcs .29
stx ZPPtr2 store real var type
bra .11
@ -652,7 +654,7 @@ CSH.ExpEval ldx ZPPtr1
.12 cmp #','
beq .8
cmp #')'
beq .85
beq .8
cmp #';'
beq .8
@ -662,9 +664,25 @@ CSH.ExpEval ldx ZPPtr1
>LDYA L.CSH.BOPS
jsr CSH.LookupOP
bcs .90
lda ZPPtr2+1 X=OP lookup,get previous OP in A
bpl .5 go check precedence
stx ZPPtr2+1
stx ZPPtr2+1 save new OP
pla get previous OP
pha
bmi .13 $ff.... push OP
cmp ZPPtr2+1
bcs .13 new OP has precedence, on stack : V1,V2
tax Old OP has precedence...
lda ZPPtr2 Var Type
jsr CSH.BOP.EXEC compute STK=V1 <OP> V2
bcs .99
ldx ZPPtr2+1
.13 phx push OP on stack
jsr CSH.GetCharNB
bcc .20 go check for an ARG
@ -677,36 +695,28 @@ CSH.ExpEval ldx ZPPtr1
jmp .11
*--------------------------------------
.5 cpx ZPPtr2+1
bcs .6
* new OP has precedence, on stack : V1,V2
jmp .10
* Old OP has precedence, compute STK=V1 <BOP> V2
.6 lda ZPPtr2 Var Type
ldx ZPPtr2+1 BOP
jsr CSH.BOP.EXEC
bcs .99
jsr CSH.GetCharNB
bcs .90
jmp .13 reset BOP & loop
.85
* >DEBUG
.8 ldx ZPPtr2+1
.8 plx any BOP on stack ?
bmi .80
lda ZPPtr2 Var Type
jsr CSH.BOP.EXEC
bcc .80
bcc .8
bcs .99
.90 lda #CSH.E.SYNTAX
.99 sec
.99 tax
.98 pla
bpl .98
txa
sec
.HS 90 BCC
.80 clc
ldx ZPPtr2 X = Var Type
ply
sty ZPPtr2+1
ply
@ -972,8 +982,8 @@ CSH.SetVarValueFromStack
cpy ZPVarSizeOf
bne .1
lda #'>'
jsr DEBUG.VAR
* lda #'>'
* jsr DEBUG.VAR
clc
rts

View File

@ -76,7 +76,8 @@ CSH.BOPS.SUBf >FPU FSUB
clc
rts
*--------------------------------------
CSH.BOPS.MUL cmp #CSH.T.FLOAT
CSH.BOPS.MUL >DEBUG
cmp #CSH.T.FLOAT
beq .8
>FPU MUL32