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.

Related Questions

Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?
The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is ____________
The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is
Each of the questions below consists of a question and three statements numbered I, II and III given below it. You have to decide whether the data provided in the statements are sufficient to answer the question. Read all the three statements and give answer. There are six letters E, I, P, G, N and O is PIGEON the word formed after performing the following operations using these six letters only? I. O is placed fourth to the right of P. G is not placed immediately next to either P or O. II. N is placed immediately next (either left or right) to O. E is placed immediately next (either left or right) to G. III. Both I and E are placed immediately next to G. The word does not begin with N. P is not placed immediately next to E.