CS 271 Quiz Responses

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Given the following register states, and using Base Indexed 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 contans the address of the first element of list.ESI register contains the address of the eleventh element of list.EBX register contains the value 40,

mov eax, [edx + ebx]

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 contans the address of the first element of list.ESI register contains the address of the eleventh element of list.EBX register contains the value 40,

mov eax, [esi]

Suppose that you are given the following program.Inside someProcedure, what numerical operand should be used with the RET instruction? .data x DWORD 153461 y DWORD 37 z WORD 90 .code main PROC push x push y push z call someProcedure inc EAX mov EBX, z xor EAX, EBX exitmain ENDP END MAIN

10

The following instruction will increment the stack pointer (ESP) by how many bytes? ret 8

12

Given the following partial data segment, what value would I put in the brackets in list[n][n] to access the 8th element of list? .MAX = 50 .data list DWORD MAX DUP(0) a DWORD 25 b DWORD 15

28

The RET instruction (without operands) will pop how many bytes off the stack?

4

In assembly language, given list, an array of WORDs, what element is addressed by list[8]?

5th Element

Register Indirect addressing is defined as follows:

Accessing memory through an address stored in a register.

The stack frame inside a procedure is also known as the ____________.

Activation Record

For this problem, suppose that you are working with the partial data segment given below. Assume that the memory address of balance is 0x44. What hexadecimal address belongs to the last item in history? HISTLIMIT = 100 .data balance DWORD 0 account WORD ? history WORD HISTLIMIT DUP(?) isValid BYTE 0

Any of the following: 0110h 0x110 x110 110 110h x0110 0x0110 0110

Suppose that you are given the following program. What hexadecimal value does EIP hold immediately after "inc EAX" has executed? .data 0x100 x DWORD 153461 0x104 y BYTE 37 0x105 z BYTE 90 .code main PROC 0x12 push x 0x17 mov AH, y 0x1C mov AL, z 0x21 call someProcedure 0x26 inc EAX 0x2B mov EBX, z 0x30 xor EAX, EBX 0x35 exit main ENDP END MAIN

Any of the following: 2Bh 0x2B x2B 2B

For this problem, suppose that you are working with the partial data segment given below. Assume that the memory address of balance is 0x44. What hexadecimal address belongs to the first item in history? HISTLIMIT = 100 .data balance DWORD 0 account WORD ? history WORD HISTLIMIT DUP(?) isValid BYTE 0

Any of the following: 4A x4A 0x4A 4Ah

Arrays are stored in ____________ memory.

Contiguous

The RET instruction pops the top of the stack into what register?

EIP

The following two instructions are equivalent. ret ret 4

False

When passing parameters to a procedure on the stack, it is usually okay to change the value of the EBP register within the procedure.

False

When passing procedure parameters on the stack, why are the following lines of code often used in a procedure? push ebp mov ebp,esp

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

If you reference a point beyond the end of an array in MASM (for example, the address of the what would be the 105th element of a 100-element array), what happens?

You attempt to access whatever data bytes are stored there.

Suppose that you are given the following program. After the instruction "mov ebp, esp", which of the following is referenced by each of the following? .data x DWORD 153461 y WORD 37 z WORD 90 .code main PROC push x push y push z call someProcedure ... exit main ENDP someProcedure PROC push ebp mov ebp, esp ... pop ebp ret 8 someProcedure ENDP END MAIN

[ebp + 4] The return address from someProcedure. [ebp + 8] The decimal value 90. [ebp + 10] The decimal value 37. [ebp + 12] The decimal value 153461. [ebp] The previous value of EBP. [ebp + 6] None of these.

Given the following register states, and using Indexed 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 contans the address of the first element of list.ESI register contains the address of the eleventh element of list.EBX register contains the value 40,

mov eax, list[ebx]


Ensembles d'études connexes

RN Nutrition Online Practice 2023 A

View Set

Chapter 11 Review Questions (no essay / short answer yet)

View Set

EXAMEN FINAL DE SEGUNDO PERIODO DE BACHILLERATO GENERAL SEGUNDO ANO

View Set

Fragile environments & climate change igcse geography

View Set

NCLEX Questions; Pediatrics: Respiratory, GI, GU, Cardiac

View Set