Kernel 0.93

This commit is contained in:
Rémy GIBERT 2019-05-07 17:39:35 +02:00
parent cda867763e
commit 29136ee0f8
3 changed files with 56 additions and 34 deletions

Binary file not shown.

View File

@ -1236,7 +1236,7 @@ CMD.NEXT.EXEC lda (pData),y Y = StkPtr
jsr CMD.NEXT.LINE
bcs .9
bpl .1
bpl .1 end of file/pipe
lda (pData)
sec
@ -1279,16 +1279,12 @@ CMD.NEXT.LINE lda (pData)
phy
>SYSCALL GetMemPtr hVARNAME
>STYA ZPVarNamePtr
ply
dey
lda (pData),y hPIPE
pha
>PUSHWI 256
>PUSHW ZPCLBuf
pla
ply
dey
lda (pData),y hFILE/hPIPE
>SYSCALL fgets
bcs .8

View File

@ -811,55 +811,81 @@ PrintF.COut phy
K.FGetS jsr PFT.CheckNodeA
bcs .9
lda (pStack)
sta ZPPtr2
ldy #1
* lda (pFD)
* bne .10
* jmp IO.READ.REG wont block
.10 lda (pStack)
sta ZPPtr2 s
ldy #1
lda (pStack),y
sta ZPPtr2+1 s
iny
lda (pStack),y
sec
sbc #2
lda (pStack),y n
* clc
sbc #1
eor #$ff
sta ZPPtr1 !n
sta ZPPtr1 !(n-2)
iny
lda (pStack),y
lda (pStack),y n
sbc #0
eor #$ff
sta ZPPtr1+1 !n
sta ZPPtr1+1 !(n-2)
jsr K.GetC.I
bcs .4
.10 jsr K.GetC.I
bcc .1
tay
bne .9 I/O ERROR
rts BLOCKING I/O
.1 cmp #C.LF Discard any leading LF
beq .10
beq .3
.2 cmp #C.CR
beq .8
jsr MEM.PutCharPtr2
jsr MEM.NextCharPtr1
beq .8
inc ZPPtr1
bne .3
inc ZPPtr1+1
beq .8 Buffer full
jsr K.GetC.I
.3 jsr K.GetC.I
bcc .2 another char...
tay BLOCKING...
bne .8
.4 tay
bne .9 I/O error
lda ZPPtr2
sta (pStack) s
lda ZPPtr2+1
ldy #1
sta (pStack),y s
lda ZPPtr1
eor #$ff
* sec
adc #1
iny
sta (pStack),y !(n+2)
jsr .9 Cancel GetC blocking
lda ZPPtr1+1
eor #$ff
adc #0
iny
sta (pStack),y !(n+2)
.8 clc
lda #0 BLOCKING I/O
sec
rts
lda #0
.8 lda #0
sta (ZPPtr2) terminate string
clc
.9 >RET 4
*/--------------------------------------
* # getchar (BLOCKING)
@ -897,7 +923,7 @@ K.GetC.I >PUSHWI 1
jsr IO.READ.I
bcc .8
tay
bne K.GetC.RTS
bne K.GetC.RTS I/O error
>RET 4 BLOCKING I/O