Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-09-06 14:50:27 +02:00
parent 5cd7a80c78
commit 237ba85627
3 changed files with 44 additions and 25 deletions

Binary file not shown.

View File

@ -104,7 +104,7 @@ CSH.Run.1 cmp #'#'
jsr CSH.GetCharNB jsr CSH.GetCharNB
bcs .9 bcs .9
cmp #'=' cmp #'=' TODO: all AOPS
bne .99 bne .99
jsr CSH.GetNextChar Skip = jsr CSH.GetNextChar Skip =
@ -113,7 +113,7 @@ CSH.Run.1 cmp #'#'
lda #0 Any Type lda #0 Any Type
jsr CSH.ExpEval jsr CSH.ExpEval
bcs .9 bcs .9
>LDYA ZPVarID X = Exp Type >LDYA ZPVarID X = Exp Type
jsr CSH.SetVarValueFromStack jsr CSH.SetVarValueFromStack
bcs .9 bcs .9
@ -166,7 +166,7 @@ CSH.IF jsr CSH.GetCharNB
cmp #')' cmp #')'
bne .9 bne .9
jsr CSH.GetNextCharNB jsr CSH.GetNextCharNB skip ')'
bcs .99 bcs .99
cmp #'{' cmp #'{'
bne .9 bne .9
@ -391,7 +391,7 @@ CSH.fCall ldx ZPPtr1
bcs .10 bcs .10
cmp #'(' cmp #'('
bne .90 bne .52
jsr CSH.GetNextCharNB skip '(' jsr CSH.GetNextCharNB skip '('
.10 bcs .90 .10 bcs .90
@ -447,7 +447,7 @@ CSH.fCall ldx ZPPtr1
lda (ZPPtr1) lda (ZPPtr1)
bne .3 Another ARG.... bne .3 Another ARG....
bra .90 extra args....error .52 bra .90 extra args....error
.6 cmp #')' .6 cmp #')'
bne .90 bne .90
@ -471,7 +471,7 @@ CSH.fCall ldx ZPPtr1
.8 jsr CSH.GetNextCharNB Skip ) .8 jsr CSH.GetNextCharNB Skip )
plx restore X = function index plx restore X = function index
ldy ZPPtr2 get type in Y
pla pla
sta ZPPtr2+1 sta ZPPtr2+1
pla pla
@ -480,9 +480,12 @@ CSH.fCall ldx ZPPtr1
sta ZPPtr1+1 sta ZPPtr1+1
pla pla
sta ZPPtr1 sta ZPPtr1
jmp (J.CSH.EXEC,x) phy
jsr .80
plx
rts
.90 lda #CSH.E.SYNTAX .90 lda #CSH.E.SYNTAX
.HS 2C BIT ABS .HS 2C BIT ABS
@ -501,6 +504,9 @@ CSH.fCall ldx ZPPtr1
stx ZPPtr1 stx ZPPtr1
.99 rts .99 rts
.80 jmp (J.CSH.EXEC,x)
*-------------------------------------- *--------------------------------------
* Input: * Input:
* ZPFileBufPtr, A = Expected type * ZPFileBufPtr, A = Expected type
@ -533,7 +539,7 @@ CSH.ExpEval ldx ZPPtr1
ldx ZPPtr2 var type (could be 0=any) ldx ZPPtr2 var type (could be 0=any)
jsr CSH.GetVarValueOnStack Y,A = VarID, Get value on stack jsr CSH.GetVarValueOnStack Y,A = VarID, Get value on stack
bcs .99 bcs .29
stx ZPPtr2 store real var type stx ZPPtr2 store real var type
bra .11 bra .11
@ -541,15 +547,20 @@ CSH.ExpEval ldx ZPPtr1
.1 lda ZPPtr2 var type .1 lda ZPPtr2 var type
jsr CSH.fCall X = function index jsr CSH.fCall X = function index
bcs .99 bcs .99
* stx ZPPtr2 store real var type stx ZPPtr2 store real var type
bra .11 bra .11
.2 jsr CSH.IsDigit10 number ? .2 jsr CSH.IsDigit10 number ?
bcs .3 bcs .3
ldx ZPPtr2 ldx ZPPtr2
jsr CSH.GetNumOnStack bne .22
bcs .99
ldx #CSH.T.INT
stx ZPPtr2
.22 jsr CSH.GetNumOnStack
.29 bcs .99
.11 jsr CSH.GetCharNB .11 jsr CSH.GetCharNB
bcs .90 bcs .90
@ -760,9 +771,13 @@ CSH.ZPPtr1AddAp1
.1 rts .1 rts
*-------------------------------------- *--------------------------------------
CSH.GetNumOnStack CSH.GetNumOnStack
cpx #CSH.T.FLOAT txa
bcc .1 beq .99
.10 cpx #CSH.T.FLOAT
bcc .1
bne .99
>PUSHWI ZPFileBufPtr >PUSHWI ZPFileBufPtr
>LDYA ZPFileBufPtr >LDYA ZPFileBufPtr
>SYSCALL StrToF >SYSCALL StrToF
@ -806,7 +821,11 @@ CSH.GetNumOnStack
inc pStack inc pStack
sta (pStack) sta (pStack)
.8 clc .8 clc
.9 rts .9 rts
.99 lda #CSH.E.TMISMATCH
sec
rts
*-------------------------------------- *--------------------------------------
* Input : ZPFileBufPtr * Input : ZPFileBufPtr
* Output : Y,A = ZPVarID * Output : Y,A = ZPVarID
@ -1192,6 +1211,8 @@ CSH.SkipBlock ldy #0 not in "", TOTO:skip comments
dex dex
bne .1 bne .1
clc
rts
.3 cmp #'"' .3 cmp #'"'
bne .1 bne .1

View File

@ -438,15 +438,13 @@ Ctrl.W jsr BUF.ComputeCOffset Y=line len
lda BUF.LOffset+1 lda BUF.LOffset+1
iny iny
sta (pData),y sta (pData),y
ply ply Get back line len
clc clc
lda (BufPtr),y lda (BufPtr),y
bne .1 beq .1 last line \0 ending
tya sec delete CR
beq .8 previoyus line\CR\0
iny
.1 tya .1 tya
@ -533,10 +531,10 @@ Ctrl.Z jsr BUF.ComputeCOffset
*-------------------------------------- *--------------------------------------
Prompt.Help >STZ.G PromptMode Prompt.Help >STZ.G PromptMode
Prompt.Help.Upd jsr SCRN.UpdateMain Prompt.Help.Upd jsr SCRN.UpdateStatusBar
bcs .9 bcs .9
jmp SCRN.UpdateStatusBar jmp SCRN.UpdateMain
.9 .9
Prompt.Help.RTS rts Prompt.Help.RTS rts
*-------------------------------------- *--------------------------------------