What will be content of Stack Pointer if following assembly code of 8051 microcontroller is executed immediately after reset? PUSH 00h POP 01h POP 02h
What will be content of Stack Pointer if following assembly code of 8051 microcontroller is executed immediately after reset? PUSH 00h POP 01h POP 02h Correct Answer 06h
PUSH –
|
Op code |
Operand |
Byte |
M-cycle |
T-state |
|
PUSH |
RP |
1 |
3 |
12T |
Push function is used to insert on dement at the top of the stock. The element is added to the stack container and size of the stack is increased by ‘1’
Pop
|
Op code |
Operand |
Byte |
M-cycle |
T-state |
|
Pop |
RP |
1 |
3 |
10T |
Pop instruction is used to delete an element from the top of the stack. The element is deleted to the stack container and size of the stack is decremented by ‘1’
8051 default stack pointer value SP = 07
PUSH 00h ⇒ SP = 07 + 1 = 08h
POP 01h ⇒ SP = 08 – 1 = 07h
POP 02h ⇒ SP = 07 – 1 = 06h
Option 2) correct choice.
মোঃ আরিফুল ইসলাম
Feb 20, 2025