Reading a Character 

Reading a single character from the keyboard may be done in either one of two ways:
With Echo: function 01 in AH, or
Without Echo: function 08 in AH

Reading a Character with Echo (Function 01H)

The following code allows you to read a single character from the keyboard and have it echoed, or displayed, on the screen:

Reading a character with echo
	
	MOV AH, 01H
	INT 21H
	;AL contains the ASCII code of the character read from the keyboard.

The ASCII code of the character read will be returned in the AL register. Note that if the character pressed does not have an ASCII code like the function keys (F1-F12) then a 00 will be stored in the register AL.

Reading a Character without Echo (Function 08H)

This function allows us to read a signle character from the keyboard. However, unlike function 01, the character will not be echoed, or shown, on the screen. This is useful when the user is aked to enter his password and it is not desirable to see what he is typing. Usually, the programmer displays a * after each key is pressed.

The following code reads a single character without displaying it on the screen.

Reading a character without echo
	
	MOV AH, 08H
	INT 21H
	;AL contains the ASCII code of the character read from the keyboard.

The ASCII code of the character read is returned in the AL register.