A2osX/SYS/KERNEL.S.TERM.txt
2023-11-04 15:42:28 +01:00

110 lines
2.0 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 jmp (.1,x)
.1 .DA TERM.STATUS
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA TERM.CONTROL
.DA A2osX.BADCALL
.DA TERM.OPEN
.DA TERM.CLOSE
.DA TERM.READ
.DA TERM.WRITE
*--------------------------------------
TERM.STATUS jsr TERM.GetIOCTLBufCntDCB
ldy #S.IOCTL.S
lda (ZPIOCTL),y
tay
bra TERM.TOAUX
*--------------------------------------
TERM.OPEN
* hFD in A for OPEN
TERM.CONTROL
TERM.CLOSE jsr TERM.GetDCB
bra TERM.TOAUX
*--------------------------------------
TERM.READ
TERM.WRITE jsr TERM.GetIOCTLBufCntDCB
*--------------------------------------
TERM.TOAUX lda A2osX.ASCREEN
sta IO.SETREADAUX
sta IO.SETWRITEAUX
cmp (ZPDCBPtr) #S.DCB.TTY.DEVID
beq .1 CS
clc
.1 ror bActive
jsr .8
sta IO.CLRREADAUX
sta IO.CLRWRITEAUX
rts
.8 jmp (TERMX,x)
*--------------------------------------
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 ZPCnt
iny
lda (ZPIOCTL),y
eor #$ff
sta ZPCnt+1
*--------------------------------------
TERM.GetDCB ldy #S.FD.DEV.DCBPTR
lda (pFD),y
sta ZPDCBPtr
iny
lda (pFD),y
sta ZPDCBPtr+1
rts
*--------------------------------------
TERM.GetBufByte sta IO.CLRREADAUX
lda (ZPBufPtr)
sta IO.SETREADAUX
rts
*--------------------------------------
TERM.GetDevName sta IO.CLRREADAUX
lda pFD
clc
adc #S.FD.DEV
sta TXTPTR
lda pFD+1
adc /S.FD.DEV
sta TXTPTR+1
sta IO.SETREADAUX
rts
*--------------------------------------
MAN
SAVE usr/src/sys/kernel.s.term
LOAD usr/src/sys/kernel.s
ASM