Kernel 0.92+

This commit is contained in:
Rémy GIBERT 2019-03-05 16:49:34 +00:00
parent d19060c13b
commit dddaf0ff4b
6 changed files with 197 additions and 31 deletions

Binary file not shown.

BIN
A2osxLogo.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -540,9 +540,170 @@ CMD.BREAK
CMD.CONTINUE CMD.CONTINUE
.9 jmp CMD.Exec.CSYN .9 jmp CMD.Exec.CSYN
*-------------------------------------- *--------------------------------------
CMD.FOR CMD.FOR lda (ZPArgVBufPtr)
beq .9
>LDYA ZPArgVBufPtr
>STYA ZPVarNamePtr
jsr CORE.ArgV.Next
beq .9
jsr ToUpperCase
cmp #'I'
bne .9
ldy #1
lda (ZPArgVBufPtr),y
beq .9
jsr ToUpperCase
cmp #'N'
bne .9
iny
lda (ZPArgVBufPtr),y
bne .9
jsr CORE.ArgV.Next
beq .9
cmp #'`'
beq FOR.EXEC
sec
jsr CORE.StkPushPtr Push CmdPtr AFTER FOR
bcs .99
>LDYA ZPArgVBufPtr
>SYSCALL strdup
bcs .99
phy
jsr CORE.StkPush
ply
bcs .99
tya
jsr CORE.StkPush Push ListPtr
bcs .99
txa
jsr CORE.StkPush Push hLIST
bcs .99
lda ZPVarNamePtr
jsr CORE.StkPush
bcs .99
lda ZPVarNamePtr+1 Push VARNAME
jsr CORE.StkPush
bcs .99
lda #C.FORLIST
jsr CORE.StkPush
bcs .99
>LDA.G CORE.Test
ora #C.FOR Push FOR
jsr CORE.StkPush
bcs .99
jmp CMD.NEXT
clc
.99 rts
.9 jmp CMD.Exec.CSYN .9 jmp CMD.Exec.CSYN
*-------------------------------------- *--------------------------------------
FOR.EXEC
* lda #$ff
* >STA.G bReadMode
clc
rts
*--------------------------------------
* stack+7 CmdPtr
* stack+5 ListPtr
* stack+4 hLIST
* stack+2 VARNAME
* stack+1 FOR SUB TOKEN
* stack FOR TOKEN
*--------------------------------------
CMD.NEXT jsr CORE.StkGet Y = StkPtr
bcs .9
tax
and #$3F
cmp #C.FOR
bne .9
dey
lda (pData),y
sta ZPVarNamePtr+1
dey
lda (pData),y
sta ZPVarNamePtr
dey skip hLIST
dey
lda (pData),y
sta ZPPtr1 get ListPtr
dey
lda (pData),y
sta ZPPtr1+1
ldy #$ff
.1 iny
lda (ZPPtr1)
beq .8
inc ZPPtr1
bne .2
inc ZPPtr1+1
.2 cmp #C.SPACE
beq .3
sta (ZPCLBuf),y
bra .1
.3 lda #0
sta (ZPCLBuf),y
tya
beq .8
lda (pData)
sec
sbc #5
tay
lda ZPPtr1
sta (pData),y
iny
lda ZPPtr1+1
sta (pData),y
iny
lda (pData),y
sta ZPInputBufPtr
iny
lda (pData),y
sta ZPInputBufPtr+1
clc
rts
.8 lda (pData)
sec
sbc #9
sta (pData)
clc
rts
.9 lda #E.NOFOR
sec
.99 rts
*--------------------------------------
CMD.WHILE CMD.WHILE
CMD.IF jsr CORE.StkGet CMD.IF jsr CORE.StkGet
bcs .1 no context... bcs .1 no context...
@ -565,7 +726,8 @@ CMD.IF jsr CORE.StkGet
cmp #C.WHILE cmp #C.WHILE
bne .8 bne .8
jsr CORE.StkPushPtr clc
jsr CORE.StkPushPtr Push BEFORE WHILE/IF
bcs .9 bcs .9
.8 >LDA.G CORE.Test .8 >LDA.G CORE.Test
@ -575,9 +737,6 @@ CMD.IF jsr CORE.StkGet
clc clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CMD.NEXT
.9 jmp CMD.Exec.CSYN
*--------------------------------------
CMD.LOOP jsr CORE.StkPull CMD.LOOP jsr CORE.StkPull
bcs .9 bcs .9
tax tax
@ -652,14 +811,7 @@ CMD.IsSwitch lda (ZPArgVBufPtr)
bne .9 bne .9
txa txa
cmp #'a' jmp ToUpperCase
bcc .8
cmp #'z'+1
bcs .8
eor #$20
.8 clc
rts
.9 sec .9 sec
rts rts

View File

@ -41,7 +41,7 @@ CORE.Quit >LDA.G CORE.hArgVBuf
* set hStdIn = hStdOut * set hStdIn = hStdOut
* set hStdOut = Std * set hStdOut = Std
*-------------------------------------- *--------------------------------------
CORE.Run.CSYN lda #E.CSYN CORE.Run.CSYN lda #E.SYN
sec sec
rts rts
@ -116,7 +116,7 @@ CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping
sta (pData),y sta (pData),y
jsr CORE.GetNextCharNB skip ". " jsr CORE.GetNextCharNB skip ". "
bcs CORE.Run.RTS nothing to execute... bcs .99 nothing to execute...
.4 >LDYA L.CMD internal command ? .4 >LDYA L.CMD internal command ?
jsr CORE.LookupInputBuf jsr CORE.LookupInputBuf
@ -129,8 +129,6 @@ CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping
txa txa
>STA.G CORE.IntCmd >STA.G CORE.IntCmd
cmp #C.EXIT
bne .42
.42 jsr CORE.StkGet .42 jsr CORE.StkGet
bcs .7 no particular context, exec... bcs .7 no particular context, exec...
@ -164,7 +162,7 @@ CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping
.44 jsr CORE.GetNextCharNB Skip EoL char .44 jsr CORE.GetNextCharNB Skip EoL char
clc clc
rts .99 rts
.5 >LDYA L.CORE.IO .5 >LDYA L.CORE.IO
jsr CORE.LookupInputBuf jsr CORE.LookupInputBuf
@ -269,13 +267,10 @@ CORE.Lookup >STYA ZPPtr2
lda (ZPPtr1),y lda (ZPPtr1),y
beq .4 Table Keyword end beq .4 Table Keyword end
lda (ZPPtr2),y lda (ZPPtr2),y
cmp #'a'
bcc .21
cmp #'z'+1
bcs .21
eor #$20
.21 cmp (ZPPtr1),y jsr ToUpperCase
cmp (ZPPtr1),y
beq .2 beq .2
bra .4 bra .4
@ -305,7 +300,7 @@ CORE.Lookup >STYA ZPPtr2
lda (ZPPtr1) Array Ending 0, must be an external Cmd.... lda (ZPPtr1) Array Ending 0, must be an external Cmd....
bne .1 bne .1
lda #E.CSYN lda #E.SYN
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -452,7 +447,7 @@ CORE.IO.Open pha Open Mode
rts rts
.9 pla .9 pla
lda #E.CSYN lda #E.SYN
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -519,10 +514,17 @@ CORE.SkipCharsA clc
*-------------------------------------- *--------------------------------------
* Stack * Stack
*-------------------------------------- *--------------------------------------
CORE.StkPushPtr lda ZPInputCmdPtr CORE.StkPushPtr bcs .1
jsr CORE.StkPush lda ZPInputCmdPtr
ldx ZPInputCmdPtr+1
bra .2
.1 lda ZPInputBufPtr
ldx ZPInputBufPtr+1
.2 jsr CORE.StkPush
bcs CORE.StkPullPtr.9 bcs CORE.StkPullPtr.9
lda ZPInputCmdPtr+1 txa
bra CORE.StkPush bra CORE.StkPush
*-------------------------------------- *--------------------------------------
CORE.StkPullPtr jsr CORE.StkPull CORE.StkPullPtr jsr CORE.StkPull

View File

@ -140,7 +140,7 @@ IO.PrintBatchErrMsg
ldy #S.PS.RC ldy #S.PS.RC
lda (pPs),y lda (pPs),y
cmp #E.CSYN cmp #E.SYN
beq .10 beq .10
>LDYA ZPInputCmdPtr >LDYA ZPInputCmdPtr

View File

@ -32,6 +32,9 @@ C.BREAK .EQ 36
C.CONTINUE .EQ 38 C.CONTINUE .EQ 38
*-------------------------------------- *--------------------------------------
C.FOR .EQ 40 C.FOR .EQ 40
C.FORLIST .EQ 0
C.FORFILE .EQ 2
C.FOREXEC .EQ 4
C.WHILE .EQ 42 C.WHILE .EQ 42
C.IF .EQ 44 C.IF .EQ 44
C.NEXT .EQ 46 C.NEXT .EQ 46
@ -528,6 +531,15 @@ RemoveStrFromArgV
bra .2 bra .2
.8 rts .8 rts
*--------------------------------------
ToUpperCase cmp #'a'
bcc .8
cmp #'z'+1
bcs .8
eor #$20
.8 clc exit CC to allow Jmp to
rts
*-------------------------------------- *--------------------------------------
.INB USR/SRC/BIN/SH.S.CL .INB USR/SRC/BIN/SH.S.CL
.INB USR/SRC/BIN/SH.S.HIS .INB USR/SRC/BIN/SH.S.HIS