Chapter 8 (Advanced Procedures) – Assessment
True-False
Please indicate whether each statement is True (T) or False (F).
1. Local variables are stored on the runtime stack, at a higher address than the stack pointer.
2. The following is a valid LOCAL declaration:
LOCAL pArray:DWORD PTR
3. The following is a valid LOCAL declaration:
LOCAL LastName:BYTE(25)
4. The following is a valid LOCAL declaration:
LOCAL index:DWORD
5. In assembly language, a variable declared using the LOCAL directive in one procedure can be
read by code in another procedure.
6. In 32-bit programs, ADDR and OFFSET return the same value.
7. The CALL instruction can only have a single operand.
8. An indirect operand such as [eax + edi] can be passed to the INVOKE directive.
9. The assembler checks the pointer type used with the ADDR operator against the pointer type
declared in the PROC directive. For example, it prevents a pointer to DWORD from being passed
to a procedure expecting an pointer to BYTE.
10. The C calling convention is used by the Irvine32 library.
11. The C calling convention requires the calling program to reset the stack pointer after the
subroutine has returned.
12. Stack parameters are usually expressed as positive offsets from ESP.
13. When a subroutine argument is passed by value, the calling program pushes the argument’s
address on the stack.
14. Arrays are usually passed by reference when calling subroutines.
15. When a 32-bit mode program needs to pass a 64-bit integer argument to a subroutine on the stack,
you should push the low-order doubleword of the argument first, followed by the high-order
doubleword.