Kernel 0.92+

This commit is contained in:
Rémy GIBERT 2019-02-22 16:08:37 +00:00
parent d70b2d90df
commit f637ced1e4
3 changed files with 51 additions and 21 deletions

View File

@ -124,7 +124,7 @@ CS.QUIT clc
*--------------------------------------
INPUT.RESET >STA.G INPUT.PassChar
>STZ.G INPUT.BufPtr
>STZ.G INPUT.BUF
>STA.G INPUT.Status
rts
*--------------------------------------
@ -133,12 +133,12 @@ INPUT.CHARIN tax save char...
>LDA.G INPUT.Status
bmi .9
lda #INPUT.BufPtr
lda #INPUT.BUF
clc
adc pData
sta ZPPTR1
lda pData+1
adc /INPUT.BufPtr
adc /INPUT.BUF
sta ZPPTR1+1
cpx #$20 Control Char?

View File

@ -360,17 +360,27 @@ IO.READ.CDEV ldx #IOCTL.READ
*--------------------------------------
IO.WRITE.CDEV ldx #IOCTL.WRITE
>PULLW K.S.IOCTL+S.IOCTL.BUFPTR
>PULLW K.S.IOCTL+S.IOCTL.BYTECNT
ldy #3
.1 lda (pStack),y
sta K.S.IOCTL+S.IOCTL.BUFPTR,y
dey
bpl .1
jsr K.IOCTL.GetPDRV
>LDYAI K.S.IOCTL
.1 jsr K.IOCTL.pDrvJmp
bcs .9
>LDYA K.S.IOCTL+S.IOCTL.BYTECNT
.9 rts
jsr K.IOCTL.pDrvJmp
bcc .8
tay CS, A=0 ?
bne .9 no, I/O error
rts BLOCKING I/O
.8 >LDYA K.S.IOCTL+S.IOCTL.BYTECNT
.9 >RET 4
*--------------------------------------
IO.WRITE.SSOCK ldy #S.FD.SSOCK.WRITE
.HS 2C BIT ABS

View File

@ -19,15 +19,22 @@ HEXBUF.Signed .EQ ARG.SIGN
* `int putchar ( int character );`
* ## ASM
* **In:**
* `lda caracter`
* `lda character`
* `>SYSCALL putchar`
* ## RETURN VALUE
* CC = success
*\--------------------------------------
K.PutChar >PUSHA
K.PutChar >PUSHA character
ldy #S.PS.hStdOut
lda (pPs),y
jsr K.FPutC
bcc .8
tay
beq K.FPutC.RET1
.8 rts
*/--------------------------------------
* # fputc (BLOCKING)
* Print A (char) to hFILE
@ -41,19 +48,27 @@ K.PutChar >PUSHA
* ## RETURN VALUE
* CC = success
*\--------------------------------------
* (pStack)+0 character
*--------------------------------------
K.FPutC jsr PFT.CheckNodeA
bcs K.FPutC.9
bcs K.FPutC.RET1
>PULLB K.IOBuf
lda (pStack) character
ldy #1
K.FPutC.Y lda #0
>PUSHYA
>PUSHWI K.IOBuf
jmp IO.Write.I
K.FPutC.9 >RET 1
>PUSHYA count
>PUSHWI K.IOBuf buf
jsr IO.Write.I
bcc K.FPutC.RET1
tay
bne K.FPutC.RET1
>RET 4 pop buf,count but keep char
K.FPutC.RET1 >RET 1 pop char
*/--------------------------------------
* # puts (BLOCKING)
* Write Str to StdOut, appends '\r\n'
@ -794,15 +809,20 @@ K.GetChar ldy #S.PS.hStdIn
* A = char
*\--------------------------------------
K.GetC jsr PFT.CheckNodeA
bcs K.GetC.9
bcs K.GetC.RTS
K.GetC.I >PUSHWI 1
>PUSHWI K.IOBuf
jsr IO.READ.I
bcs K.GetC.9
lda K.IOBuf
K.GetC.9 rts
bcc .8
tay
bne K.GetC.RTS
>RET 4 BLOCKING I/O
.8 lda K.IOBuf
K.GetC.RTS rts
*/--------------------------------------
* # SScanF
* Read formatted data from string