PAGE ;GBcbios3 - Unit Record I/O. ; CompuPro Interfacer board equates. GBP0: EQU 0 ;Serial port zero GBP1: EQU 2 ;Serial port one GBDATA: EQU 0 ;Data on even I/O unit GBSTAT: EQU 1 ;Status on odd I/O unit GBTBMT: EQU 0000_0001B ;Transmit buffer empty GBDAV: EQU 0000_0010B ;Data available GBOPT: EQU 0000_0100B ;Optional status line GBPE: EQU 0000_1000B ;Parity error GBOR: EQU 0001_0000B ;Overrun error GBFE: EQU 0010_0000B ;Framing error GBCC: EQU 0100_0000B ;RS 232 CC input GBCB: EQU 1000_0000B ;RS 232 CB input GBRIE: EQU 0000_0001B ;Receiver interrupt enable GBTIE: EQU 0000_0010B ;Transmitter interrupt enable GBCD: EQU 0000_0100B ;RS 232 CD output GBCA: EQU 0000_1000B ;RS 232 CA output GBTSB: EQU 0001_0000B ;Number of stop bits GBNP: EQU 0010_0000B ;No parity GBEPS: EQU 0100_0000B ;Even parity GBNBI: EQU 1000_0000B ;number of bits/character PAGE ; C O N S O L S T A T U S ; ; This routine samples the Console status and returns the ; following values in the A registe---+----+----+----+----+----+ ; ST2 | | CM | DD | WC | SH | SN | BC | MD | ; +----+----+----+----+----+----+----+----+ ; ready to read. CONST: if @ldr <> 4 INB GBP0+GBSTAT ;Input from port AND AL,#GBDAV ;Mask data available JZ CNST1 ;If data not available OR AL,#0FFH CNST1: RET endif SPACE 4,10 ; C O N S O L I N P U T ; ; Read the next character into the A register, clearing ; the high order bit. If no character currently ready to ; read then wait for a character to arrive before returning. : ; EXIT A = character read from terminal. CONIN: if @ldr <> 4 INB GBP0+GBSTAT AND AL,#GBDAV JZ CONIN ;If data not available INB GBP0+GBDATA AND AL,#7FH endif RET SPACE 4,10 ; C O N S O L O U T P U T ; ; Send a character to the console. If the console ; is not ready to receive a character wait until ; the console is ready. ; ; ENTRY C = ASCII character to output to console. CONOUT: INB GBP0+GBSTAT AND AL,#GBTBMT JZ CONOUT ;If transmit buffer not empty MOV AL,CL OUTB GBP0+GBDATA RET SPACE 4,10 ; P u n c h O u t p u t. ; ; Send a character to the punch device. If no punch ; device exists then immediately return. ; ; ENTRY C = ASCII character to output. PUNCH: if @ldr <> 4 INB GBP1+GBSTAT AND AL,#GBTBMT JZ PUNCH ;If transmit buffer full MOV AL,CL OUTB GBP1+GBDATA endif RET SPACE 4,10 ; R e a d e r I n p u t. ; ; Read the next character from the currently assigned ; reader device into the A register. ; ; EXIT A = character read from the reader device. READER: if @ldr <> 4 INB GBP1+GBSTAT ;Input from port AND AL,#GBDAV ;Mask data available JZ READER ;If data not available INB GBP1+GBDATA endif RET SPACE 4,10 ; L i s t O u t p u t. ; ; Send a character to the list device. If the list ; device is not ready to receive a character wait ; until the device is ready. ; ; ENTRY C = ASCII character to be output. LIST: if @ldr <> 4 INB GBP1+GBSTAT ;Get status AND AL,#GBCC+GBTBMT SUB AL,#GBTBMT JNZ LIST MOV AL,CL OUTB GBP1+GBDATA RET ENDIF SPACE 4,10 ; L i s t S t a t u s. ; ; Return the ready status for the list device. ; ; EXIT A = 0 (zero), list device is not ready to ; accept another character. ; A = FFh (255), list device is ready to accept ; a character. LISTST: if @ldr <> 4 INB GBP1+GBSTAT AND AL,#GBCC+GBTBMT SUB AL,#GBTBMT JZ LSTST1 ;If ready OR AL,#0FFH LSTST1: endif RET space 4,10 ; G e t M e m o r y M a p GETSGT: LD BX,#MRT ;Get table address RET space 4,10 ; G e t I O B Y T E ; ; Get the IOBYTE. GETIOB: LD AL,IOBYTE RET space 4,10 ; S e t I O B Y T E ; ; Set the IOBYTE. SETIOB: STO CL,IOBYTE ;Store the IOBYTE RET IF BANG Link GBcbiot3.A86 endif IF SMORG Link GBcbiou3.A86 endif IF INTER3 Link GBcbiov3.A86 endif ; Endx GBcbios3