Kernel 0.92+

This commit is contained in:
Rémy GIBERT 2019-03-08 11:16:19 +00:00
parent f3581d5595
commit c64f702460
2 changed files with 159 additions and 9 deletions

Binary file not shown.

View File

@ -683,11 +683,66 @@ FOR.FILE sec
.99 rts
*--------------------------------------
FOR.EXEC
* lda #$ff
* >STA.G bReadMode
clc
rts
FOR.EXEC sec
jsr CORE.StkPushPtr Push CmdPtr AFTER FOR
bcs .9
jsr CORE.ArgV.NextChar skip "`"
jsr IO.Pipe.Out
bcs .99
>PUSHBI S.PS.F.DUPENV
>LDYA ZPArgVBufPtr
>SYSCALL execl
bcs .99
>LDA.G IO.hOut
ldy #S.PS.hStdOut
sta (pPS),y
>STZ.G IO.hOut
>PUSHWI 0 auxtype
>PUSHBI 0 type
>PUSHBI O.RDONLY+O.TEXT
>LEA.G IO.NodBuf
>SYSCALL fopen
.9 bcs .99
jsr CORE.StkPush push hPIPE
bcs .99
>LDYA ZPVarNamePtr
>SYSCALL strdup
bcs .99
txa
jsr CORE.StkPush Push hVARNAME
bcs .99
lda #C.FOR.EXEC
jsr CORE.StkPush
bcs .99
lda #C.FOR
jsr CORE.StkPush
bcs .99
jsr CMD.NEXT.EXEC.1
bcs .99
>ORA.G CORE.Test
ora #C.FOR Push FOR
pha
lda (pData)
tay
pla
sta (pData),y
* clc
.99 rts
*--------------------------------------
CMD.NEXT jsr CORE.StkGet Y = StkPtr
@ -775,10 +830,22 @@ CMD.NEXT.LIST.1 lda (pData)
lda (pData),y
sta ZPPtr1+1
ldy #$ff
ldy #0
.1 iny
lda (ZPPtr1)
.10 lda (ZPPtr1)
beq .3
inc ZPPtr1
bne .11
inc ZPPtr1+1
.11 cmp #C.SPACE
beq .10
sta (ZPCLBuf),y
iny
.1 lda (ZPPtr1)
beq .3
inc ZPPtr1
@ -789,6 +856,7 @@ CMD.NEXT.LIST.1 lda (pData)
beq .3
sta (ZPCLBuf),y
iny
bra .1
.3 lda #0
@ -909,8 +977,90 @@ CMD.NEXT.FILE.1 lda (pData)
* clc
.9 rts
*--------------------------------------
CMD.NEXT.EXEC clc
* stack-4 CmdPtr
* stack-3 hPIPE
* stack-2 hVARNAME
* stack-1 FOR SUB TOKEN
* stack FOR TOKEN
*--------------------------------------
CMD.NEXT.EXEC lda (pData),y Y = StkPtr
bpl .1
jsr CMD.NEXT.FILE.1
bcs .9
bpl .1
lda (pData)
sec
sbc #4
tay
lda (pData),y
sta ZPInputBufPtr+1
dey
lda (pData),y
sta ZPInputBufPtr
clc
rts
.1 lda (pData)
tay
sec
sbc #6
sta (pData)
dey
dey
lda (pData),y hVARNAME
pha
dey
lda (pData),y hPIPE
>SYSCALL fclose
pla
>SYSCALL freemem
* clc
.9 rts
*--------------------------------------
CMD.NEXT.EXEC.1 lda (pData)
dec skip FOR
dec skip SUB TOKEN
tay
lda (pData),y
phy
>SYSCALL GetMemPtr hVARNAME
>STYA ZPVarNamePtr
ply
dey
lda (pData),y hPIPE
pha
>PUSHWI 256
>PUSHW ZPCLBuf
pla
>SYSCALL fgets
bcs .8
>PUSHW ZPCLBuf
>LDYA ZPVarNamePtr
>SYSCALL SetEnv
bcs .9
lda #$80
* clc
rts
.8 >LDYA ZPVarNamePtr
>SYSCALL UnSetEnv
bcs .9
lda #0
* clc
.9 rts
*--------------------------------------
CMD.WHILE
CMD.IF jsr CORE.StkGet