home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
sigm
/
vol247
/
z19-mods.lbr
/
INSERT.A86
< prev
next >
Wrap
Text File
|
1986-02-27
|
2KB
|
56 lines
;************************************************
; *
; Console input Routine *
; *
;************************************************
conin_0:
;------
; ENTRY: bx = addr of the Q control block
; EXIT: ah = 0 if characters are being returned.
; ah = 0FFH if this is a screen switch code being returned
push bx ; save the Q control addr
call serial_in ; get the character
cmp al,80H ;is it an 8bit char?
ja do8_0 ;if yes, go to 8bit routine
pop bx ; restore the Q control addr
mov ah, 0 ; set ah as a character code
and al,07fh ;strip 8th bit if any
ret
;**********************************************************
; 8bit conversion routine
;
do8_0: and al,07fh ;strip the 8th bit
pop bx ;get Q ctl addr
cmp al,'S' ;is it an ' (S)
jb do8_1 ;jmp if less than S
cmp al,'S'+vcoff-1 ;is it over allowed # of vir cons
ja do8_1 ;jmp if over
; otherwise we DO have a screen switch character
sub al,'S' ;normalize screen # to 0
mov ah,0ffh ;set screen switch return code
ret
;***********************************************************
; convert any other stripped 8bit char with CONTAB
do8_1:
sbb al,'#' ;set table offset cnt to 0
jb do8_2 ;too low, can't use
push bx ;save Q ctl addr
mov bx,offset contab ;beg addr of CONTAB
mov ah,0 ;set normal return char code
add bx,ax ;determine offset
mov al,[bx] ;converted char from table
pop bx ;get Q ctl addr back
ret
do8_2:
mov ax,00 ;force a null
ret