Module #7 Study Deck Flashcards
The following two instructions are equivalent.
RET & RET 4
True/False
False
When passing procedure parameters on the stack, why are the following lines of code often necessary in a procedure?
PUSH EBP
MOV EBP, ESP
- To preserve the original EBP register value for register indirect addressing.
- They are never necessary.
- Because the procedure might change the EBP register value.
- To keep additional usage of the stack within the procedure from invalidating the stack offsets.
To keep additional usage of the stack within the procedure from invalidating the stack offsets.
The following instruction will increment the stack pointer (ESP) by how many bytes? (Ignore the .0 after the number. Canvas insists on pushing decimals even when kindly asked not to).
ret 7
11
To access stack-passed parameters in a procedure, which addressing mode is used?
* Base + Offset
* Register Indirect
* Indexed Operands
* Register Direct
Base + Offset
Given the following register states, and using Register Indirect addressing, which of the following lines of code will move the 11th element of the list array (of DWORDs) to the EAX register?
EDX register contains the address (OFFSET) of the first element of list.
ESI register contains the address (OFFSET) of the eleventh element of list.
EBX register contains the value 40.
- MOV EAX, list[ESI]
- MOV EAX, [EDX + EBX]
- MOV EAX, [ESI]
- MOV EAX, list[EBX]
MOV EAX, [ESI]
Given list, an array of WORDs, what element is addressed by list[8]?
4th Element
8th Element
9th Element
5th Element
5th Element
Given the following register states, and using Indexed Operands addressing, which of the following lines of code will move the 11th element of the list array (of DWORDs) to the EAX register?
EDX register contains the address (OFFSET) of the first element of list.
ESI register contains the address (OFFSET) of the eleventh element of list.
EBX register contains the value 40.
- MOV EAX, [EDX + EBX]
- MOV EAX, [ESI]
- MOV EAX, list[ESI]
- MOV EAX, list[EBX]
MOV EAX, list[EBX]
Arrays elements are stored in ____________ memory.
* Contiguous
* Random
* Disjoint
Contiguous
The _________ operator returns a value that is equivalent to multiplying the number of elements in a single data declaration by the size, in bytes, of a single element of a data declaration.
* SIZEOF
* OFFSET
* TYPE
* PTR
* LENGTHOF
SIZEOF
The _________ operator returns a count of the number of elements in a single data declaration.
* TYPE
* OFFSET
* SIZEOF
* PTR
* LENGTHOF
LENGTHOF
The _________ operator returns the size, in bytes, of a single element of a data declaration.
* OFFSET
* LENGTHOF
* PTR
* TYPE
* SIZEOF
TYPE