29 lines
304 B
Plaintext
29 lines
304 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
|
|
|
|
ret
|