Program counter (PC) in 8085 Microprocessor

MicrocontrollerMicroprocessor8085

PC is a 16-bit register. It contains a memory address. PC contains that very memory address from where the next instruction is to be fetched for execution. Suppose the PC contents are 8000H, then it means that the 8085 Desires to fetch the instruction Byte at 8000H. After fetching the Byte at 8000H, the PC is automatically incremented by 1. This way 8085 becomes ready to fetch the next Byte of the instruction (in case instruction fetch is incomplete), or fetch the next opcode (in case instruction fetch is over).

So in this example, first of all PC is loaded with the value 8000H. This is done by typing the ‘Go’ key, then typing “8000”, and finally typing the “Exec” key. Then the 8085 performs the following action. It sends out 8000H the address, which is the content of the PC. From location 8000H it receives 21H, the opcode for LXI H. It is received in an 8-bit register called instruction register (IR for short), as shown in the following figure.

Address
Hex Codes
Label
Mnemonic
T-States
Comment
8000
21 (IR)
50 (Z)
80 (W)
START:
LXI H, 8050H
10
Setup HL pair as a pointer for source memory.
8003
11 (IR)
70 (Z)
80 (W)

LXI D, 8070H
10
Set up DE pair as a pointer for destination memory
8006
76 (IR)

HLT
5
Stop
raja
Published on 11-Mar-2019 10:33:19
Advertisements