Summary Exercise - Week 7 [2]

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Suppose that you are given the following program (with memory addresses shown on the left).What hexadecimal value does EIP hold immediately after "inc EAX" has executed? .data 0x100 x DWORD 153461 0x104 y WORD 37 0x105 z WORD 90 .codemain PROC 0x12 push x 0x17 mov AX, y 0x1C shl AX, 16 0x1C mov AX, z 0x21 call someProcedure 0x26 inc EAX 0x2B mov EBX, z 0x30 xor EAX, EBX 0x35 exit main ENDP END MAIN

0x2B

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

0x4A

Given the following partial data segment, what value would I put in the brackets in list1 to access the 4th element of list? (Ignore the .0000 that Canvas may append to your answer). .MAX = 50 .data list DWORD MAX DUP(0) a DWORD 25 b DWORD 15

12

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

4

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

8

The following two instructions are equivalent. ret ret 4 True False

False

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, a) mov eax, list[ebx] b) mov eax, [esi] c) mov eax, [edx + ebx] d) mov eax, list[esi]

a) mov eax, list[ebx]

Given list, an array of WORDs, what element is addressed by list[8]? Hint: It's Love. a)5th Element b)8th Element c)9th Element d)4th Element

a)5th Element

Register Indirect addressing is defined as follows: a) Accessing register contents as a value. b) Accessing memory through an address stored in a register. c) Accessing a memory area specified and maintained by a pointer in the ESP register. d) None of these.

b) Accessing memory through an address stored in a register.

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? a) Run-time error b) Compile-time error c) You attempt to access whatever data bytes are stored there. d) The disassembler prevents your program from compiling.

c) You attempt to access whatever data bytes are stored there.

The RET instruction (without operands) will pop how many bytes off the stack? a)8 b)2 c)4 d)16

c)4

The RET instruction pops the top of the stack into what register? a)EBP b)ESP c)EIP d)It does not pop the top of the stack into a register.

c)EIP

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, a)mov eax, list[esi] b)mov eax, [edx + ebx] c)mov eax, [esi] d)mov eax, list[ebx]

c)mov eax, [esi]


Kaugnay na mga set ng pag-aaral

REAL 4000 Test 3 LCPQ (calc only)

View Set

Word formed by shortening - English Language.

View Set

Elementary astronomy Modules 1-7

View Set

Assignment: Chapter 13: Managing Communication

View Set

Pharm 3 - Receptor Binding: Agonist & Antagonists

View Set