EttinOS/SOURCE/READCH.INC

30 lines
311 B
Plaintext

;Reads a character to AL
readch:
;Store the initial registers
push bx
push ax
;Read a keypress
mov ah, 0x0
int 0x16
;Check for non-printing characters
cmp al, 0x1f
jle readch
cmp al, 0x7f
je readch
;Print the character
mov ah, 0xe
int 0x10
;Load the initial registers
pop bx
mov ah, bh
pop bx
.done:
ret