mov ah, 0Bh ;Check Keyboard Status
int 21h
cmp al, 0 ;zero means not ready
je not_ready
Check Keyboard Status (Function 0Bh) determines whether a character is available from standard input.
This function has no parameters.
If a character is available, the AL register contains 0FFh. Otherwise, the AL register contains 00h.
This function does not indicate how many characters are available, only that there is at least one.
Function 01h Read Keyboard with Echo
Function 06h Direct Console I/O
Function 07h Direct Console Input
Function 08h Read Keyboard Without Echo
Function 0Ah Buffered Keyboard Input
Function 3Fh Read File or Device