A2osX/SYS/KERNEL.S.TERM.txt
2020-02-04 21:04:33 +01:00

130 lines
2.4 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
AUTO 3,1
*--------------------------------------
DRV.TERM cld
jmp (.1,x)
.1 .DA DRV.TERM.STATUS.LC
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA DRV.TERM.CONTROL.LC
.DA A2osX.BADCALL
.DA DRV.TERM.OPEN.LC
.DA DRV.TERM.CLOSE.LC
.DA DRV.TERM.READ.LC
.DA DRV.TERM.WRITE.LC
*--------------------------------------
DRV.TERM.STATUS.LC
jsr DRV.TERM.GetIOCTLBufCntDCB
ldy #S.IOCTL.STATCODE
lda (ZPIOCTL),y
bra DRV.TERM.TOAUX
DRV.TERM.CONTROL.LC
DRV.TERM.OPEN.LC
DRV.TERM.CLOSE.LC
pha DEV.ID in A for OPEN
jsr DRV.TERM.GetDCB
pla
bra DRV.TERM.TOAUX
DRV.TERM.READ.LC
DRV.TERM.WRITE.LC
jsr DRV.TERM.GetIOCTLBufCntDCB
*--------------------------------------
DRV.TERM.TOAUX sta SETREADAUX
sta SETWRITEAUX
jsr .1
sta CLRREADAUX
sta CLRWRITEAUX
rts
.1 jmp (.2,x)
.2 .DA DRV.TERM.STATUS
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA DRV.TERM.CONTROL
.DA A2osX.BADCALL
.DA DRV.TERM.OPEN
.DA DRV.TERM.CLOSE
.DA DRV.TERM.READ
.DA DRV.TERM.WRITE
*--------------------------------------
DRV.TERM.GetIOCTLBufCntDCB
>STYA ZPIOCTL
ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y
sta ZPBufPtr
iny
lda (ZPIOCTL),y
sta ZPBufPtr+1
iny #S.IOCTL.BYTECNT
lda (ZPIOCTL),y
eor #$ff
sta ZPCount
iny
lda (ZPIOCTL),y
eor #$ff
sta ZPCount+1
*--------------------------------------
DRV.TERM.GetDCB ldy #S.FD.DEV.DCBPTR
lda (pFD),y
sta ZPDCBPtr
iny
lda (pFD),y
sta ZPDCBPtr+1
iny S.FD.DEV.BUFPTR
lda (pFD),y
sta ZPBufBase
iny
lda (pFD),y
sta ZPBufBase+1
lda (ZPDCBPtr) #S.DCB.TTY.DEVID
cmp DevMgr.ASCREEN
beq .1 CS
clc
.1 ror bActive
rts
*--------------------------------------
DRV.TERM.GetBufByte
sta CLRREADAUX
lda (ZPBufPtr)
sta SETREADAUX
rts
*--------------------------------------
DRV.TERM.GetDevName
sta CLRREADAUX
lda (ZPDCBPtr) #S.DCB.TTY.DEVID
tax
lda Dev.Table-1,x
clc
adc #S.FD.DEV
sta TXTPTR
lda Dev.Table,x
adc /S.FD.DEV
sta TXTPTR+1
sta SETREADAUX
rts
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.TERM
LOAD USR/SRC/SYS/KERNEL.S
ASM