Module #7 Study Deck Flashcards

1
Q

The following two instructions are equivalent.
RET & RET 4
True/False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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.
A

To keep additional usage of the stack within the procedure from invalidating the stack offsets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

To access stack-passed parameters in a procedure, which addressing mode is used?
* Base + Offset
* Register Indirect
* Indexed Operands
* Register Direct

A

Base + Offset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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]
A

MOV EAX, [ESI]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Given list, an array of WORDs, what element is addressed by list[8]?

4th Element
8th Element
9th Element
5th Element

A

5th Element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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]
A

MOV EAX, list[EBX]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Arrays elements are stored in ____________ memory.
* Contiguous
* Random
* Disjoint

A

Contiguous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

SIZEOF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The _________ operator returns a count of the number of elements in a single data declaration.
* TYPE
* OFFSET
* SIZEOF
* PTR
* LENGTHOF

A

LENGTHOF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The _________ operator returns the size, in bytes, of a single element of a data declaration.
* OFFSET
* LENGTHOF
* PTR
* TYPE
* SIZEOF

A

TYPE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly