home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
nor_asm
/
kbd_io19.asm
< prev
next >
Wrap
Assembly Source File
|
1989-05-17
|
821b
|
32 lines
.MODEL SMALL
.CODE
PUBLIC READ_BYTE
;-----------------------------------------------------------------------;
; This procedure reads a single ASCII character. This is just ;
; a test version of READ_BYTE. ;
; ;
; Returns: AL Character code (unless AH = 1) ;
; AH 0 if read ASCII char ;
; 1 if read a special key ;
;-----------------------------------------------------------------------;
READ_BYTE PROC
XOR AH,AH ;Ask for keyboard read function
INT 16h ;Read character/scan code from keyboard
OR AL,AL ;Is it an extended code?
JZ EXTENDED_CODE ;Yes
NOT_EXTENDED:
XOR AH,AH ;Return just the ASCII code
DONE_READING:
RET
EXTENDED_CODE:
MOV AL,AH ;Put scan code into AL
MOV AH,1 ;Signal extended code
JMP DONE_READING
READ_BYTE ENDP
END