Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-11-10 18:43:20 +01:00
parent 51c45b2074
commit 9c8764a6ae
5 changed files with 83 additions and 15 deletions

Binary file not shown.

Binary file not shown.

View File

@ -273,6 +273,9 @@ CL.GetLine lda (ZPFileBufPtr)
cmp #C.CR cmp #C.CR
beq .6 beq .6
* cmp #';'
* beq .6
sta (ZPCMDBuf),y sta (ZPCMDBuf),y
iny iny
cpy #CmdLine.MAX cpy #CmdLine.MAX
@ -282,7 +285,7 @@ CL.GetLine lda (ZPFileBufPtr)
* sec * sec
rts rts
.6 sec skip CR .6 sec skip CR or ;
.HS 90 BCC .HS 90 BCC
.7 clc .7 clc

View File

@ -295,12 +295,6 @@ Cmd.INT.ECHO ldx #1
.8 clc .8 clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
Cmd.INT.ELSE clc
rts
*--------------------------------------
Cmd.INT.FI clc
rts
*--------------------------------------
Cmd.INT.READ ldx #1 Cmd.INT.READ ldx #1
jsr Cmd.GetArgX jsr Cmd.GetArgX
beq .9 beq .9
@ -456,7 +450,13 @@ Cmd.INT.RD ldx #1
.9 jmp Cmd.Exec.ERRSYN .9 jmp Cmd.Exec.ERRSYN
*-------------------------------------- *--------------------------------------
Cmd.INT.IF ldx #1 Cmd.INT.IF >LDA.G CMD.IF.PTR
cmp #CMD.IF.PTR+CMD.IF.STACK.MAX
beq .90
inc
sta (pData),y
ldx #1
jsr Cmd.GetArgX jsr Cmd.GetArgX
beq .9 beq .9
@ -470,8 +470,11 @@ Cmd.INT.IF ldx #1
bcs .9 bcs .9
dex dex
dex 1 or $ff dex 1 or $ff
>LDA.G CMD.IF.PTR
tay
txa txa
>STA.G CMD.IF.NOT sta (pData),y true or false
ldx #2 ldx #2
jsr Cmd.GetArgX jsr Cmd.GetArgX
@ -480,22 +483,78 @@ Cmd.INT.IF ldx #1
>PUSHYA >PUSHYA
>LDYA L.CMD.IF.TOKEN2 -d -e -f ? >LDYA L.CMD.IF.TOKEN2 -d -e -f ?
jsr Lookup jsr Lookup
bcs .1 bcs .1
jmp (J.CMD.IF.TOKEN2,x) jsr CMD.IF.UNARY
bcs .99
>LDA.G CMD.IF.PTR
tay
txa
eor #$ff
eor (pData),y
sta (pData),y
ldx #4
jsr Cmd.GetArgX
beq .9
>STYA ZPPTR1
lda (ZPPTR1)
cmp #']'
bne .9
ldy #1
lda (ZPPTR1),y
bne .9
.1 .1
clc
.99 rts
.9 >LDA.G CMD.IF.PTR
.90 jmp Cmd.Exec.ERRSYN
*--------------------------------------
CMD.IF.UNARY jmp (J.CMD.IF.TOKEN2,x)
CMD.IF.D
CMD.IF.E
CMD.IF.F
ldx #1 true
clc
rts
*--------------------------------------
Cmd.INT.ELSE >LDA.G CMD.IF.PTR
cmp #CMD.IF.PTR
beq .9
tay
lda (pData),y
eor #$ff
sta (pData),y
clc clc
rts rts
.9 jmp Cmd.Exec.ERRSYN .9 lda #E.SYN
sec
rts
*-------------------------------------- *--------------------------------------
CMD.IF.D Cmd.INT.FI >LDA.G CMD.IF.PTR
CMD.IF.E cmp #CMD.IF.PTR
CMD.IF.F beq .9
dec
>STA.G CMD.IF.PTR
clc clc
rts rts
.9 lda #E.SYN
sec
rts
*-------------------------------------- *--------------------------------------
Cmd.GetArgX >LDYA ZPArgVBuf Cmd.GetArgX >LDYA ZPArgVBuf

View File

@ -42,7 +42,10 @@ CS.START cld
.DA CS.END-CS.START CS .DA CS.END-CS.START CS
.DA DS.END-DS.START DS .DA DS.END-DS.START DS
.DA #64 SS .DA #64 SS
.DO CSH=1
.DA #20 ZP .DA #20 ZP
.ELSE
.DA #12 ZP
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
* Relocation Table * Relocation Table
@ -128,6 +131,10 @@ CS.RUN jsr SetPWD
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPFileBufPtr >STYA ZPFileBufPtr
lda #CMD.IF.PTR
tay
sta (pData),y
.DO CSH=1 .DO CSH=1
jsr CSH.Init jsr CSH.Init
.FIN .FIN
@ -494,7 +501,6 @@ CMD.VarName .BS VarLen.MAX+1
CMD.Stat .BS S.STAT CMD.Stat .BS S.STAT
CMD.Time .BS S.TIME CMD.Time .BS S.TIME
CMD.IF.NOT .BS 1
CMD.IF.PTR .BS 1 CMD.IF.PTR .BS 1
CMD.IF.STACK .BS CMD.IF.STACK.MAX CMD.IF.STACK .BS CMD.IF.STACK.MAX