ch5 IO
ch5 IO
1
04-Oct-22
2
04-Oct-22
OUT instruction
• The OUT instruction is described as follows:
OUT 8-bit Port Address
• This is a two-byte instruction with the hex. Opcode D3, and the
second byte is the port address of an output device.
• This instruction transfers (copies) data from the accumulator to
the output device.
• For example, OUT 01H instruction will be stored in memory as:
Memory Machine code Mnemonics Memory Contents
address
2051 01 ; 01H
3
04-Oct-22
4
04-Oct-22
IN instruction
• The IN instruction is described as follows:
IN 8-bit Port Address
• This is a two-byte instruction with the hex. Opcode DB, and the
second byte is the port address of an input device.
• This instruction reads (copies) data from an input device and
places the data byte in the accumulator.
• For example, IN 84H instruction will be stored in memory as:
Memory Machine code Mnemonics Memory Contents
address
2066 84 ; 84H
5
04-Oct-22
6
04-Oct-22
7
04-Oct-22
8
04-Oct-22
9
04-Oct-22
10
04-Oct-22
11
04-Oct-22
12
04-Oct-22
13
04-Oct-22
14
04-Oct-22
15
04-Oct-22
Application: Program
16
04-Oct-22
17