Function 01h Read Keyboard with Echo

mov ah, 01h ;Read Keyboard with Echo

int 21h

mov InputChar, al ;character from standard input

Read Keyboard with Echo (Function 01h) reads a character from the standard input device and writes it to the standard output device. If no character is ready, MS-DOS waits until one is available.

This function has been superseded by Read File or Device (Function 3Fh).

Parameters

This function has no parameters.

Return Value

The AL register contains the input character.

Comments

Upon reading a carriage-return character (0Dh), this function sends the standard output device a carriage return but not a linefeed (that is, it sets the cursor to the beginning of the current line).

If the character read from the keyboard is an extended key code (for example, if the user presses one of the function keys), Read Keyboard with Echo returns 00h and the program must call the function again to get the second byte of the extended key code.

See Also

Function 3Fh Read File or Device