Question

In: Computer Science

If this program below has an initial Stack Pointer value of (ESP=2000 2090h), what is the...

If this program below has an initial Stack Pointer value of (ESP=2000 2090h), what is the value of the Stack Pointer (ESP) after the last instruction (pop ax) is finished.

     mov bx, 09h

     mov ax, 0h   

     push bx

     pop ax   

Question 3 options:

       ESP = 2000 2094h

       ESP = 2000 2090h

       ESP = 2000 2092h

       ESP = 2000 208Eh

Solutions

Expert Solution

EXPLANATION:

  • mov instruction is used for moving the date from source to destination, in which a source could be a register, immediate value or a register containing memory location, and destination could be a register. In the provided assembly program, the source is the immediate value(09h and 0h) and the destination is a register(bx and ax)
  • push instruction is used for transferring the two bytes of data from the register to the stack memory. push instruction first decrements the Stack Pointer(ESP) value by 2 bytes and then transfers the data.
  • pop instruction performs the opposite operation of push instruction, it fetches the 2 bytes of data from stack memory locations and stores it in the register, and then it increments the Stack Pointer(ESP) value by 2 bytes.

INSTRUCTIONS:

mov bx, 09h ; Moving the 09h value in b register ,  (ESP=2000 2090h)

     mov ax, 0h ; Moving the 0h value in a register ,  (ESP=2000 2090h)

     push bx ; Pushing b register value in Stack Pointer , (ESP=2000 208Eh)

     pop ax ; Popping the 2 bytes values from Stack to a register,  (ESP=2000 2090h)

ANSWER:

Hence the value of the Stack Pointer (ESP) after the last instruction (pop ax) is finished will be ESP=2000 2090h


Related Solutions

What is the present value of a growing perpetuity that has an initial payment of $20,000...
What is the present value of a growing perpetuity that has an initial payment of $20,000 one year from now. Assume a growth rate of 5% and a rate of return equal to 9%. Question options: $50,000.00 $500,000.00 $222,222,22 $400,000.00
What is the net present value of a project that has an initial cash outflow of...
What is the net present value of a project that has an initial cash outflow of $-13,000, at time 0, and the following cash flows for years 1-4? The required return is 10.0%. DO NOT USE DOLLAR SIGNS OR COMMAS IN YOUR ANSWER. ENTER YOUR ANSWER TO THE NEAREST DOLLAR (e.g. 1250). Year Cash Flows 1 $3,950 2 $3,750 3 $5,900 4 $6,400
A new machine costs $42,000 and has a $2000 salvage value at the end of its...
A new machine costs $42,000 and has a $2000 salvage value at the end of its 8-year useful life. Determine the straight-line (SL), and the double declining balance (DDB) depreciation schedules for the machine.
Illustrate the stack and the heap allocation. Specify what each variable value holds and where different...
Illustrate the stack and the heap allocation. Specify what each variable value holds and where different references are pointing to. char[] class = {'C','O','M','P','1','2','2'"}; #define int n = 4; long long fibb(long long a, long long b, int n) { return (--n>0)?(fibb(b, a+b, n)):(a); } int main() { fib(3); //illustrate what memory looks like at this point return 0; }
C programming Illustrate the stack and the heap allocation. Specify what each variable value holds and...
C programming Illustrate the stack and the heap allocation. Specify what each variable value holds and where different references are pointing to. int main() { char str[20]; scanf("%[^\n]%*c", str); //illustrate how memory is allocated at this point printf("%s", str); return 0; }
Machine A has an initial cost of $19,500 and a salvage value of $7500 (today's value)...
Machine A has an initial cost of $19,500 and a salvage value of $7500 (today's value) at the end of its 12 year life. Machine B has an initial cost of $17,900 and a salvage value of $2300 (today's value) at the end of it's 6 year life. Inflation is 3.9%                                           Don’t forget, we will need to increase the costs and salvage values by inflation for any transaction other than year 0.                                              The company uses a MARR rate of 14%                                            ...
What is the net present value of this investment? INITIAL COST                                
What is the net present value of this investment? INITIAL COST                                 $500,000 PROJECT LIFE                                 15 years SALVAGE VALUE                           $ 20,000 ANNUAL NET CASH FLOWS          $120,000    DISCOUNT RATE                                15 %             a.     $ 203,684             b.    $ 204,142             c.     $ 205,669             d.    $ 206,263             e.     $ 208,721
Rate of return=[Initial value(Current value−Initial value)​]×100 where can I find that Form 10-K. What numbers would...
Rate of return=[Initial value(Current value−Initial value)​]×100 where can I find that Form 10-K. What numbers would I be looking at? Can you please provide examples. Thanks
Solve the initial value problem below using the method of Laplace transforms. y'' - 4y' +...
Solve the initial value problem below using the method of Laplace transforms. y'' - 4y' + 8y = 5e^t y(0) = 1 y'(0) = 3
John began his investing program with a $5,500 initial investment. The table below recaps his returns...
John began his investing program with a $5,500 initial investment. The table below recaps his returns each year as well as the amounts he added to his investment account. What is his dollar-weighted average return? Time Investment Return 0 $ 5,500 8.5 % 1 $ 2,000 - 5.0 % 2 $ 2,600 4.5 % 3 $ 3,000 9.0 % 4 $ 900 - 2.5 % A-1.8 percent B-1.5 percent C-2.6 percent D-2.0 percent E-2.2 percent
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT