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 register. ; ; EXIT A = 0 (zero), means no character ; currently ready to read. ; ; A = FFh (255), means character ; currently 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