A2osX/SYS/KERNEL.S.IO.txt
2018-06-19 07:55:12 +02:00

86 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
*--------------------------------------
IO.COut ldy #S.NODE.T
lda (pNode),y
asl
tax
*--------------------------------------
jmp (.1,x)
.1 .DA STDIO.Out.REG
.DA STDIO.IOERR DIR
.DA STDIO.Out.CDEV
.DA STDIO.IOERR BDEV
.DA STDIO.IOERR LNK
.DA STDIO.IOERR DSOCK
.DA STDIO.Out.SSOCK
.DA STDIO.Out.FIFO
*--------------------------------------
IO.COut.REG >PUSHW pIOBuf
>PUSHW STDIO.Out.Cnt
ldy #S.NODE.REG.REF
>PUSHB (pNode),y
jmp K.FWrite
*--------------------------------------
IO.COut.CDEV ldy #S.NODE.DEV.JMP
lda (pNode),y
sta .1+1
iny
lda (pNode),y
sta .1+2
lda K.IOBuf
ldx #IOCTL.WRITE
.1 jmp $ffff
*--------------------------------------
IO.COut.SSOCK lda (pNode) #S.NODE.HANDLER
jsr K.GetMemPtr.A
>STYA .1
ldy #S.NODE.SSOCK.HSKT
>PUSHB (pNode),y
>PUSHB K.IOBuf
ldy #S.NODE.SSOCK.WRITE
lda (pNode),y
tax Function Offset for write
.1 jmp $ffff
*--------------------------------------
IO.COut.FIFO ldy #S.NODE.FIFO.S
lda (pNode),y
beq .9 Remote PS did not opened yet the pipe
cmp #S.NODE.FIFO.S.Closed
beq .99 Remote PS closed the Pipe
ldy #S.NODE.FIFO.hMem
lda (pNode),y
jsr K.GetMemPtr.A
>STYA .1+2
ldy #S.NODE.FIFO.Head
lda (pNode),y
inc
dey #S.NODE.FIFO.Tail
cmp (pNode),y
beq .9 FIFO is full
iny
sta (pNode),y
tay
lda K.IOBuf
.1 sta $ffff,y
clc
rts
.9 lda #MLI.E.VOLFULL
.HS 2C bit abs
.99 lda #MLI.E.EOF
sec
rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.IO
LOAD /A2OSX.SRC/SYS/KERNEL.S
ASM