0% found this document useful (0 votes)
11 views8 pages

Microprocessor Systems: Dr. Mona Sayed

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Microprocessor Systems: Dr. Mona Sayed

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Microprocessor Systems

Lecture Notes # 9

Dr. Mona Sayed


Outline of the Lecture
 Input and Output (I/O) in 8086 Assembly Language
Input and Output (I/O) in 8086 Assembly Language

 Input a single character with echo

INT 21H Option 01H


MOV AH, 01
INT 21H
 This function waits until a character is input for the keyboard, then
echoes it to the monitor.
 The input character (ASCII) will be in AL
 With echo

MOV AH, 01
INT 21H
 Without echo
MOV AH, 07
INT 21H
Output a single character to monitor

INT 21H Option 02H


MOV AH, 02
MOV DL, ‘M’
INT 21H
 DL is loaded with the character to be displayed
 The difference between output a character and output a string
Output a character
MOV DL, ...
MOV AH, 02h
INT 21h
Load the desired character in to DL, then call the interrupt with function
code 2 in AH.
Output a string
MOV DX, ...
MOV AH, 09h
INT 21h
Load the address of a '$'-terminated string into DX, then call the
interrupt with function code 9 in AH.
•LEA ( Load Effective Address )
The format of LEA instruction is

LEA register, source

LEA is an instruction which calculates an a address and then then


loads it into the double register designated in the mnemonic. It must
use the indexed addressing mode.

You might also like