Bcz of CALL, SP will be decremented by 2. Then bcz of POP, SP will get incremented by 2. So, SP will be 27FFH. But, I am confused with HL register part. Please help me with the above problem.
- SP Points to address 27FF
CALL occurs at 1003, So PC's current value is stored on to stack. CALL is a 3 byte instruction, means PC points to -> 1003+3 = 1006. It is stored on to Stack (decrement and store).
27FE <- 06, 27FD <- 10 and SP now points to the top, 27FD.
Program control is taken to 1006 by CALL.
POP H will Pop values from the Stack to HL reg pair(pop and increment).
H <- 10 , L <- 06. SP will point to 27FF.