The following sequences of instructions are executed by 8085 µP:
C000 LX1 SP, D050 D050 05
C003 POPH D051 40
C004 XRA A D052 52
C005 MOV A, H D053 03
C006 ADD L D054 XX
C007 MOV H, A
C008 PUSH H
C009 PUSH PSW
COOA HLT
What are the contents of Stack Pointer (SP), Program Counter (PC), Accumulator and HL
pair?
The content of SP = D050H. After execution of POP H, the content of SP = D050 + 2 = D052H.
When PUSH H is executed, the content of SP will be D052-2 = D050H. After execution of PUSH
PSW, the content of SP = D050-2 = D04E.
Program Counter (PC) content is C00B after complete execution of above program.
The content of HL register after execution of LX1 SP, D050 and POP H is 4005. When XRA A
is executed, Accumulator will be cleared or 00H. After execution of MOV A,H and ADD L, the
content of A is 45H. Therefore the content of HL register pair is 4505H.