Question

7. (True/False): Nested procedure calls are not permitted by the Microsoft assembler unless the NESTED operator...

7. (True/False): Nested procedure calls are not permitted by the Microsoft assembler unless the NESTED operator is used in the procedure definition.

15. What will be the final value in EAX after these instructions execute?

push 5

push 6

pop eax

pop eax

3. Which instruction pops the stack into the EFLAGS register?

17. Which statement is true about what will happen when the example code runs?

1: main PROC

2: mov eax,30

3: push eax

4: push 40

5: call Ex3Sub

6: INVOKE ExitProcess,0

7: main ENDP

8:

9: Ex3Sub PROC

10: pusha

11: mov eax,80

12: popa

13: ret

14: Ex3Sub ENDP

a. EAX will equal 40 on line 6

b. The program will halt with a runtime error on Line 6

c. EAX will equal 30 on line 6

d. The program will halt with a runtime error on Line 13

Homework Answers

Answer #1

7. False (there is no NESTED operator).

15. 5

Explanation:

After the first push operation the stack contains (5). After the second push operation the stack contains (6) on top of 5 on the stack. The first pop operation removes the top of the stack (6) and stores it in EAX and after 2nd pop operation removes top stack (5) and stores it in EAX.The final value will be 5.

3. popf

17. (d)

Explanation:

It will crash on line 11 . This is  because in Ex2Sub the pop eax removes the topmost item from the stack, which is the return address. So when ret tries to do the same, it will see the next item, which was 20 and unlikely to be a correct code address.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
13. (True/False): The register list in the USES directive must use commas to separate the register...
13. (True/False): The register list in the USES directive must use commas to separate the register names. 11. (True/False): The USES operator lets you name all registers that are modified within a procedure. 2. Which instruction pushes the 32-bit EFLAGS register on the stack? 18. Which statement is true about what will happen when the example code runs? 1: main PROC 2: mov eax,40 3: push offset Here 4: jmp Ex4Sub 5: Here: 6: mov eax,30 7: INVOKE ExitProcess,0 8:...
6. (True/False): The RET instruction pops the top of the stack into the instruction pointer. 8....
6. (True/False): The RET instruction pops the top of the stack into the instruction pointer. 8. (True/False): In protected mode, each procedure call uses a minimum of 4 bytes of stack space. 1. Which instruction pushes all of the 32-bit general-purpose registers on the stack? 20. What values will be written to the array when the following code executes? .data array DWORD 4 DUP(0) .code main PROC mov eax,10 mov esi,0 call proc_1 add esi,4 add eax,10 mov array[esi],eax INVOKE...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in BL. Bits 6-7 in BL should be cleared, and AL should be unchanged             Mov al, bl       And 00111111, bl       Write a sequence of two instructions that copies the integer in bits 4-7 from AL register into bits 0-3 of the BL register. Upper 4 bits of AL and BL will be cleared             Shr al, 4       Mov bl,...