A2osX/SYS/KERNEL.S.TERM.txt
2020-12-15 14:23:22 +01:00

109 lines
1.9 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 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.STATCODE
lda (ZPIOCTL),y
tay
bra TERM.TOAUX
TERM.OPEN sta ZPDevID DEV.ID 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 SETREADAUX
sta SETWRITEAUX
cmp (ZPDCBPtr) #S.DCB.TTY.DEVID
beq .1 CS
clc
.1 ror bActive
sta SET80STORE
jsr .8
sta CLRREADAUX
sta 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 ZPCount
iny
lda (ZPIOCTL),y
eor #$ff
sta ZPCount+1
*--------------------------------------
TERM.GetDCB ldy #S.FD.DEV.DCBPTR
lda (pFD),y
sta ZPDCBPtr
iny
lda (pFD),y
sta ZPDCBPtr+1
rts
*--------------------------------------
TERM.GetBufByte sta CLRREADAUX
lda (ZPBufPtr)
sta SETREADAUX
rts
*--------------------------------------
TERM.GetDevName sta CLRREADAUX
lda Dev.Table-1,x
clc
adc #S.FD.DEV
tay
lda Dev.Table,x
adc /S.FD.DEV
sta SETREADAUX
rts
*--------------------------------------
MAN
SAVE usr/src/sys/kernel.s.term
LOAD usr/src/sys/kernel.s
ASM