Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

7. In this program below, before the first PUSH is performed, the stack pointer

ID: 3736919 • Letter: 7

Question

7. In this program below, before the first PUSH is performed, the stack pointer (ESP) has the value ESP=1000 00F6. What is the final value of ESP after the last POP is performed?

mov bx, BBBBh
mov ax, AAAAh
mov cx, CCCCh
push cx
push bx
push ax
pop cx
pop ax
pop bx
What is the Final value of ESP? (Points : 10)        ESP=1000 00F0
       ESP=1000 00F6

       ESP=1000 00F8
       ESP=1000 00FA
       ESP=1000 00FD Question 8.8. How many bytes are stored in the stack when a CALL statement is performed in a 32 bit hardware environment? (Points : 2)        8 Bytes
       4 Bytes
       2 Bytes
       1 Byte Question 9.9. How many bytes are removed from the stack when a RET statement is performed in a 32 bit hardware environment? (Points : 2)        10 Bytes
       8 Bytes
       4 Bytes
       2 Bytes
       1 Byte Question 10.10. Where is the STACK located?
(Points : 2)        Main Memory
       CPU
       USB Drive Question 11.11. The ESP points to what? (Points : 2)        Top of the STACK

       Bottom of the STACK

       Middle of the STACK
Question 12.12. During the CALL statement, what is placed on the STACK?
(Points : 2)        The Address of the CALL

       The Address of the Procedure

       The Return Address (Address you return to when you exit the Procedure)

       The Address of the Main Procedure
       The Address of the RET statement Question 13.13. The Stack Pointer ESP = 1234 00FCh before a POP AX instruction is performed. What is the value of the ESP after the POP AX instruction? (Remember AX is a 16 bit Register). (Points : 10)        ESP= 1234 00FC
       ESP= 1234 00F8
       ESP= 1234 00F6
       ESP= 1234 00FE
       ESP= 1234 00FA Question 14.14.The Stack Pointer ESP=1234 00FCh before a POP EAX instruction is performed. What is the value of the ESP after the POP EAX instruction? (Remember EAX is a 32 bit Register).
(Points : 10)        ESP= 1234 00FC
       ESP= 1234 00F8
       ESP= 1234 00F6
       ESP= 1234 00FA
       ESP = 1234 0100 7. In this program below, before the first PUSH is performed, the stack pointer (ESP) has the value ESP=1000 00F6. What is the final value of ESP after the last POP is performed?

mov bx, BBBBh
mov ax, AAAAh
mov cx, CCCCh
push cx
push bx
push ax
pop cx
pop ax
pop bx
What is the Final value of ESP? (Points : 10)        ESP=1000 00F0
       ESP=1000 00F6

       ESP=1000 00F8
       ESP=1000 00FA
       ESP=1000 00FD

Explanation / Answer

7. ESP = 1000 00F6
In push subtract 4 bytes and in pop add 4 bytes
after push cx
ESP = ESP-4 = 1000 00F2

after push bX
ESP = ESP-4 = 1000 00EE

after push ax
ESP = ESP-4 = 1000 00EA

after pop cx
ESP = ESP+4 = 1000 00EE

after pop ax
ESP = ESP+4 = 1000 00F2

after pop bx
ESP = ESP+4 = 1000 00F6


8.8 When a CALL statement is performed in 32 bt hardware environment
Return address is stored in the stack so that after completion of call, the next statemnt after call is executed.
So 4 bytes are stored in stack.


9.9 When RET statment is performed, then next instruction to be executed will be the instruction folllowing the most recently executed call instruction.
That return address was stored in stack which is popped. So 4 bytes are rempved from stack.

10.10 Staxk is used for static memory allocation and stored in computer's main memory which is RAM. And access to this memory is very fast.

11.11 ESP (Extended Staxk Pointer) always points to the top of stack. As stack follows a LIFO (Last in First Out) pattern, so the pushing an popping takes place from the top only.

12.12 During CALL statement, The Return Address (Address you return to when you exit the Procedure) is stored.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote