Kernel 0.93

This commit is contained in:
Rémy GIBERT 2019-05-23 17:38:32 +02:00
parent b2f8dc8f91
commit 44dad84209
7 changed files with 131 additions and 74 deletions

Binary file not shown.

View File

@ -152,7 +152,7 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
sta hFILE sta hFILE
.2 >PUSHWI 256 .2 >PUSHWI 254 Leave room for CRLF
>PUSHW ZPBufPtr >PUSHW ZPBufPtr
lda hFILE lda hFILE
@ -211,7 +211,20 @@ CS.RUN.PRINT inc LineNum
lda bPrintAll lda bPrintAll
bmi .3 bmi .3
>LDYA ZPBufPtr ldy #$ff
.20 iny
lda (ZPBufPtr),y
beq .21
cmp #C.SPACE
bcs .20
lda #C.SPACE
sta (ZPBufPtr),y
bra .20
.21 >LDYA ZPBufPtr
>SYSCALL puts >SYSCALL puts
rts rts

View File

@ -316,10 +316,10 @@ CkeckOption lda (ZPPtr1)
.3 ldy OptionVars-1,x .3 ldy OptionVars-1,x
eor #$80 toggle option eor #$80 toggle option
sta (pData),y sta $0,y
lda #0 exit with 0 lda #0 exit with 0
.8 clc !0 if bot an option .8 clc !0 if not an option
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END

View File

@ -1,6 +1,8 @@
NEW NEW
AUTO 3,1 AUTO 3,1
*-------------------------------------- *--------------------------------------
AUXPIPE .EQ 0
*--------------------------------------
ZPKERNEL .EQ $0 ZPKERNEL .EQ $0
*-------------------------------------- *--------------------------------------
ZPPtr1 .EQ ZPKERNEL ZPPtr1 .EQ ZPKERNEL

View File

@ -465,67 +465,6 @@ IO.READ.PIPE ldy #S.FD.PIPE.Used+1
eor #$ff eor #$ff
sta IO.Counter+1 sta IO.Counter+1
ldy #S.FD.PIPE.Size+1
lda (pFD),y
sta .5+1 Page Count
ldy #S.FD.PIPE.hMem
lda (pFD),y
jsr K.GetMemPtr
sty .2+1
sta .7+1 Pipe Buffer Base
ldy #S.FD.PIPE.Tail+1
clc
adc (pFD),y
sta .2+2
dey S.FD.PIPE.Tail
lda (pFD),y
tay
ldx #0
.1 inc IO.Counter
bne .2
inc IO.Counter+1
beq .8
.2 lda $ffff,y SELF MODIFIED
.3 sta $ffff,x SELF MODIFIED
inx
bne .4
inc .3+2
.4 iny
bne .1
ldy #S.FD.PIPE.Tail+1
lda (pFD),y
inc
.5 cmp #$ff SELF MODIFIED
beq .6
sta (pFD),y
inc .2+2
ldy #0
bra .1
.6 lda #0
sta (pFD),y
.7 lda #$ff SELF MODIFIED
sta .2+2 Restore Pipe Buf base
ldy #0
bra .1
.8 tya
ldy #S.FD.PIPE.Tail
sta (pFD),y
ldy #S.FD.PIPE.Free ldy #S.FD.PIPE.Free
clc clc
@ -552,6 +491,84 @@ IO.READ.PIPE ldy #S.FD.PIPE.Used+1
sbc .81+1 sbc .81+1
sta (pFD),y sta (pFD),y
ldy #S.FD.PIPE.Size+1
lda (pFD),y
sta .5+1 Page Count
ldy #S.FD.PIPE.hMem
lda (pFD),y
.DO AUXPIPE=1
sta SETREADAUX
.FIN
jsr K.GetMemPtr
.DO AUXPIPE=1
sta CLRREADAUX
.FIN
sty .2+1
sta .7+1 Pipe Buffer Base
ldy #S.FD.PIPE.Tail+1
clc
adc (pFD),y
sta .2+2
dey S.FD.PIPE.Tail
lda (pFD),y
tay
ldx #0
.13 .DO AUXPIPE=1
sta SETREADAUX
.FIN
.1 inc IO.Counter
bne .2
inc IO.Counter+1
beq .8
.2 lda $ffff,y SELF MODIFIED
.3 sta $ffff,x SELF MODIFIED
inx
bne .4
inc .3+2
.4 iny
bne .1
.DO AUXPIPE=1
sta CLRREADAUX
.FIN
ldy #S.FD.PIPE.Tail+1
lda (pFD),y
inc
.5 cmp #$ff SELF MODIFIED
beq .6
sta (pFD),y
inc .2+2
ldy #0
bra .13
.6 lda #0
sta (pFD),y
.7 lda #$ff SELF MODIFIED
sta .2+2 Restore Pipe Buf base
ldy #0
bra .13
.8 .DO AUXPIPE=1
sta CLRREADAUX
.FIN
tya
ldy #S.FD.PIPE.Tail
sta (pFD),y
.80 ldy #$ff SELF MODIFIED .80 ldy #$ff SELF MODIFIED
.81 lda #$ff Y,A = bytes read .81 lda #$ff Y,A = bytes read
@ -594,7 +611,7 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
txa txa
sta (pFD),y store new Free sta (pFD),y store new Free
>PULLW .2+1 get buf >PULLW .2+1 get dst buf
>PULLA get cnt lo >PULLA get cnt lo
sta .80+1 sta .80+1
@ -623,7 +640,14 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
ldy #S.FD.PIPE.hMem ldy #S.FD.PIPE.hMem
lda (pFD),y lda (pFD),y
jsr K.GetMemPtr
.DO AUXPIPE=1
sta SETREADAUX
.FIN
jsr K.GetMemPtr get src buf
.DO AUXPIPE=1
sta CLRREADAUX
.FIN
sty .3+1 sty .3+1
sta .7+1 Pipe Buffer Base sta .7+1 Pipe Buffer Base
@ -633,12 +657,16 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
adc (pFD),y adc (pFD),y
sta .3+2 sta .3+2
ldx #0
dey dey
lda (pFD),y lda (pFD),y
tay S.FD.PIPE.Head tay S.FD.PIPE.Head
ldx #0
.10 .DO AUXPIPE=1
sta SETWRITEAUX
.FIN
.1 inc IO.Counter .1 inc IO.Counter
bne .2 bne .2
inc IO.Counter+1 inc IO.Counter+1
@ -655,6 +683,10 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
.4 iny .4 iny
bne .1 bne .1
.DO AUXPIPE=1
sta CLRWRITEAUX
.FIN
ldy #S.FD.PIPE.Head+1 ldy #S.FD.PIPE.Head+1
lda (pFD),y lda (pFD),y
inc inc
@ -664,7 +696,7 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
sta (pFD),y sta (pFD),y
inc .3+2 inc .3+2
ldy #0 ldy #0
bra .1 bra .10
.6 lda #0 .6 lda #0
sta (pFD),y sta (pFD),y
@ -672,9 +704,13 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
.7 lda #$ff SELF MODIFIED .7 lda #$ff SELF MODIFIED
sta .3+2 sta .3+2
ldy #0 ldy #0
bra .1 bra .10
.8 tya .8 .DO AUXPIPE=1
sta CLRWRITEAUX
.FIN
tya
ldy #S.FD.PIPE.Head ldy #S.FD.PIPE.Head
sta (pFD),y sta (pFD),y

View File

@ -606,7 +606,6 @@ K.GetStkObjData sta SETREADAUX
lda (ZPMemMgrTmp1),y lda (ZPMemMgrTmp1),y
ply ply
sta CLRREADAUX sta CLRREADAUX
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -383,8 +383,11 @@ K.MKFIFO
* A = hFD * A = hFD
*\-------------------------------------- *\--------------------------------------
K.Pipe >STYA ZPPtr1 K.Pipe >STYA ZPPtr1
* jsr K.NewStkObj Buffer in AUX mem .DO AUXPIPE=1
jsr K.NewStkObj Buffer in AUX mem
.ELSE
jsr K.GetMem jsr K.GetMem
.FIN
bcs .99 bcs .99
stx .1+1 save PIPE buffer stx .1+1 save PIPE buffer
@ -423,7 +426,11 @@ K.Pipe >STYA ZPPtr1
.9 pha save error code .9 pha save error code
lda .1+1 get back PIPE buffer lda .1+1 get back PIPE buffer
.DO AUXPIPE=1
jsr K.FreeStkObj
.ELSE
jsr K.FreeMem jsr K.FreeMem
.FIB
pla pla
sec sec