1 if a procedure recursively calls itself millions of times what is the likely resul 5346773

1. If a procedure recursively calls itself millions of times, what is the likely result?

a. The program will continue to run until interrupted by the user.

b. The number of recursive calls will be limited by the value placed in the RL (recurion limiter) register.

c. The amount of memory usage will be constant, because the procedure is simply branching to its own offset.

d. The stack will overflow.

2. What advantages do stack parameters have over register parameters?

a. Stack parameters reduce code clutter because registers do not have to be saved and restored.

b. Programs using stack parameres execute more quickly.

c. Stack parameters are incompatible with high-leve languages.

d. Register parameters are optimized for speed.

3. MySub PROC, N:DWORD CMP N,7 je L1 mov eax, N inc eax INVOKE MySub, eaxL1: retMySub ENDPConsider the procedure named MySub. Which of the following statements are true?

a. MySub uses 4 doublewords of stack space each time it is called.

b. MySub is recursive

c. MySub terminates when N is equal to 8.

d. the parameter N is equivaleent to [EBP+4].

4. Which of the following PROT statements are valid?

a. MySub PROTO, val1:WORD, val2:DWORD.

b. MySub PROTO USES eax, val1:WORD, val2:DWORD

c. MySub PROTO USES eax ebx, val1:WORD, val2:DWORD

d. MySub PROTO, val1:WORD, val2:DWORD LOCAL v1:BYTE

5. Which of the following INVOKE statement are invalid?

a. INVOKE mySub, [array+2].

b. INVOKE mySub, 30.

c. INVOKE mySub, ADDR myList.

d. INVOKE mySub, PTR myList

6. Assuming that a procedure contains no local variables, a stack frame is created by which sequence of actions at runtime?

a. arguments pushed on stack; procedure called; EBP set to ESP; EBP pushed on stack.

b. arguments pushed on stack; EBP pushed on stack; EBP set to ESP; procedure called.

c. EBP pushed on stack; arguments pushed on stack; procedure called; EBP set to ESP.

d. arguments pushed on stack; procedure called; EBP pushed on stack; EBP set to ESP.

7. Which of the following PROC statements are invalid?

a. MySub PROC. val1: BYTE, val2: SDWORD.

b. MySub PROC, val1:PTR WORD, val2:DWORD

c. MySub PROC val1: WORD, val2:DWORD

d. None of the above

8. Which of the following are true about the C language specifier in the .MODEL directive?

a. The RET instruction removes parameters from the stack.

b. The calling program removes parameters froom the stack.

c. Inside the procedure, the POP instruction removed parameters from the stack before RET executes.

d. Afer the CALL instructions, a constant value is added to EBP to remove parameters from the stack.

9. Which of the following are true regarding local variables?

a. They make efficient use of memory because their storage space can be released.

b. They can be accessed from anywhere inside the same source code module.

c. They are usually created in the data segement.

d. None of the above.

10. main PROC mov eax,0 push 8 call Accum call DumpRegs exitmain ENDPAccum PROC push ebp mov ebp,esp mov ebx,[ebp+8] cmp ebx,2 je L1 add eax,ebx sub ebx,2 push ebx call AccumL1: pop ebp ret 4Accum ENDPRefer to program above. What will be the value of EBX when DumpRegs is called?

a. 2.

b. 4.

c. 6.

d. 8.

11. How does using the LEA instruction differ from using the OFFSET operator with MOV?

a. LEA cannot have an indirect source operand, whereas MOV-OFFSET can.

b. MOV-OFFSET retrieves a 32-bit offset, whereas LEA retrieves a combined segment-offset address.

c. LEA is effective for obtaining the address of a stack parameter.

d. The source operand used by LEA must be a constant value known at assembly time.

12. What advantages does INVOKE offer over the CALL instruction?

a. None. INVOKE is just a synonym for CALL.

b. INVOKE permits you to pass arguments separated by commas.

c. CALL does not require the use of the PROTO directive.

d. INVOKE executes more quickly than CALL.

13. main PROC mov eax,0 push 8 call Accum call DumpRegs exitmain ENDPAccum PROC push ebp mov ebp,esp mov ebx,[ebp+8] cmp ebx,2 je L1 add eax,ebx sub ebx,2 push ebx call AccumL1: pop ebp ret 4Accum ENDPRefer to program above. How many stack bytes are used by each call to Accum? a. 4 bytes b. 8 bytes c. 12 bytes d. 16 bytes

14. Which of the following are true regarding the ADDR operator? a. ADDR makes it possible to pass arguments by reference. b. ADDR passes parameters on the stack. c. ADDR always passes parameters by value. d. ADDR is not permitted in Real-mode programs.

15. MySub PROC, N:DWORD cmp N,7 je L1 mov eax,N inc eax INVOKE MySub,eaxL1: retMySub ENDP Consider the MySub procedure from the previous question. If it were called with N = 5, how many times would the RET instruction execute? a. 2 times. b. 3 times. c. 4 times. d. 5 times.

16. Which action must take place inside a procedure to reserve space on the stack for two doubleword local variables? a. after PUSH EBP, subtract 8 from the base pointer (EBP) b. after PUSH EBP, add 8 to the base pointer (EBP) c. after MOV EBP,ESP, add 8 to the stack pointer (ESP) d. after MOV EBP,ESP, subtract 8 from the stack pointer (ESP)

17. How are static variables distinguished from global variables? a. Static variables are visible from all procedures in the source code file. b. Static variables have a shorter lifetime than global variables. c. The lifetime of a static variable is the same as the lifetime of its program. d. Static variables are created on the stack, using the ESP and EBP registers.

18. main PROC mov eax,0 push 8 call Accum call DumpRegs exitmain ENDPAccum PROC push ebp mov ebp,esp mov ebx,[ebp+8] cmp ebx,2 je L1 add eax,ebx sub ebx,2 push ebx call AccumL1: pop ebp ret 4Accum ENDPRefer to program above. What will be the value of EAX when DumpRegs is called? a. 8 b. 0Ah c. 12h d. 14h

19. Which of the following shows the procedure entry code generated by MASM when the LOCAL directive is used to declare a doubleword variable? a. mov ebp,esppush ebpsub esp,4 b. push ebpmov esp,ebpadd esp,4 c. push ebpmov ebp,espsub esp,4 d. push ebpmov ebp,espadd esp,4

20. Which of the following defines an array local variable consisting of 50 signed words? a. LOCAL wArray[50]:SWORD b. LOCAL wArray:SWORD[50] c. LOCAL SWORD[50]:wArray d. LOCAL SWORD:wArray[50]

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now