Exam 3

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

Select the best answer. Execute the program below and select what the value of Register CH will be: .data myVar 3 DUP WORD (21h) myTable DWORD 37h,83h,92h,40h .codemov esi, OFFSET myTablemov CH, [esi+4]

83h

Select the right option for the dropdown. Consider this code snapshot: MOV DX, 0010h MOV ECX, 20h Jolie: SUB DL, 02 ADD DH, DL LOOP Jolie Done : After the execution of the code above, Register ECX will be equal to __________.

00000000h

Select the best answer. Execute the program below and select what the value of Register ECX will be: .data myVar1 WORD 6745h myVar2 DWORD 78563210h myVar3 BYTE 5Ah .code mov edi, Offset mVar1 mov ECX, [edi+2]

78563210h

Fill in the blank. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction on the same row: Offset Instruction 2A61h mov ebx,eax 2A63h xor edx, edx 2A65h mov eax,[ebx+$03AC] 2A6Bh mov ecx, [eax] 2A6Dh mov ebx,4 2A6Fh add ebx, 1 When the CPU is executing the instruction mov eax,[ebx+$03AC], the register EIP contains the value __________ (provide the answer as an 8-digit hexadecimal number).

00002A6Bh

Select the best answer. Execute the program below and select what the value of Register CH will be: .data myVar BYTE 20h myTable WORD 12h, 56h, 90h,78h .code mov esi, OFFSET myVar mov CH, [esi+2]

00h

Match each directive to the variable size (in bytes) BYTE WORD DWORD

1 2 4

Check all that apply. String primitive instructions (e.g., MOVSB, CMPSB..) can be used with arrays Strings of characters are exactly the same as arrays of characters. There is no fundamental difference between strings and arrays

1. String primitive instructions (e.g., MOVSB, CMPSB..) can be used with arrays 2. Strings of characters are exactly the same as arrays of characters. 3. There is no fundamental difference between strings and arrays

Select the best answer. Execute the program below and select what the value of Register CH will be: .data myVar1 WORD 6745h myVar2 DWORD 78563210h myVar3 BYTE 5Ah .code mov esi, Offset mVar2 mov CH, [esi]

10h

Fill in the blank. Consider this program that we start executing from the first (top) instruction marked by the label start. start : jmp finish looping: mov eax, 1 add eax, eax mov ebx, eax jmp deer finish: jmp looping deer : add ebx, ebx We assign to each instruction (including jumps) a sequence number that depends on when it is executed. Assuming that the first instruction is assigned the sequence number 1, then the instruction jmp looping should be assigned the sequence number __________.

2

Matching. Do you know the sequence of actions that a CPU takes to respond to an interrupt? The objective of this question is to assign to each CPU action a sequence number. The smallest sequence number is assigned to the earliest action. Match each action to the right sequence number. CPU determines the address Airh of the interrupt handler routine (irh). 2 CPU completes execution of current instruction 1 The CPU restores state register (EFLAGS), EIP ... from the stack. 4 Interrupt handler routine is executed 3

2 1 4 3

Matching. Do you know the sequence of actions that a CPU takes to respond to an interrupt? The objective of this question is to assign to each CPU action a sequence number. The smallest sequence number is assigned to the earliest element. Match each action to the right sequence number. CPU writes Airh in EIP 2 CPU saves program counter (EIP), state register (EFLAGS), ... 1 The CPU restores state register (EFLAGS), EIP ... from the stack.... 4 Interrupt handler routine is executed 3

2 1 4 3

Select the right option for the dropdown. Consider this code snapshot: MOV DL, 0FFh MOV CL, 10h CMP CL, DL JL L1 MOV CL, 22h JMP L2 L1 : MOV CL, 33h L2: After the execution of the code above, Register CL will be equal to ____ .

22

Fill in the blank. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction. The second column (labeled "Labels") contains the labels. The rightmost column contains the instructions. Offset Labels Instruction 2A61h tulip: mov ebx,eax 2A63h xor edx, edx 2A65h mov eax,[ebx+$03AC] 2A6Bh mov ecx, [eax] 2A6Dh mov ebx, 42A6Fh jmp tulip After the CPU executes the instruction jmp tulip, the register EIP contains the value ___________ .

2A61h

Fill in the blank. Consider this program that we start executing from the first (top) instruction marked by the label start. start : jmp finish looping: mov eax, 1 add eax, eax mov ebx, eax jmp deer finish: jmp looping deer : add ebx, ebx We assign to each instruction (including jumps) a sequence number that depends on when it is executed. Assuming that the first instruction is assigned the sequence number 1, then the instruction add eax, eax should be assigned the sequence number __________.

4

Fill in the blank. Consider this program that we start executing from the first (top) instruction marked by the label start. start : jmp finish looping: mov eax, 1 add eax, eax mov ebx, eax jmp deer finish: jmp looping deer : add ebx, ebx We assign to each instruction (including jumps) a sequence number that depends on when it is executed. Assuming that the first instruction is assigned the sequence number 1, then the instruction mov ebx,eax should be assigned the sequence number __________.

5

Select the best answer. Execute the program below and select what the value of Register ECX will be: .data myVar1 WORD 6745h myVar2 DWORD 78563210h myVar3 BYTE 5Ah .codemov edi, Offset mVar1 mov ECX, [edi+1]

56321067h

Select the best answer. Execute the program below and select what the value of Register BH will be: .data myVar1 WORD 6745h myVar2 DWORD 78563210h myVar3 BYTE 5Ah .code mov esi, Offset mVar2 mov BH, [esi+4]

5Ah

Fill in the blank. Consider this program that we start executing from the first (top) instruction marked by the label start. start : jmp finish looping: mov eax, 1 add eax, eax mov ebx, eax jmp deer finish: jmp looping deer : add ebx, ebx We assign to each instruction (including jumps) a sequence number that depends on when it is executed. Assuming that the first instruction is assigned the sequence number 1, then the instruction add ebx, ebx should be assigned the sequence number __________.

7

Fill in the blank. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction on the same row: OffsetInstruction 7781h mov ebx,eax 7783h xor edx, edx 7785h mov eax,[ebx+$03AC] 778Bh mov ecx, [eax] 778Dh mov ebx,4 778Fh add ebx, 1 When the CPU is executing the instruction mov eax,[ebx+$03AC], the register EIP contains the value ___________ .

778Bh

Fill in the blank. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction on the same row: OffsetInstruction 7781h mov ebx,eax 7783h xor edx, edx 7785h mov eax,[ebx+$03AC] 778Bh mov ecx, [eax] 778Dh mov ebx,4 778Fh add ebx, 1 When the CPU is executing the instruction mov ebx, 4 the register EIP contains the value ___________ .

778Fh

Fill in multiple blanks Consider the following code snapshot: call myRoutineadd ax, 2 We assume the following: 1) the offset of the instruction add ax, 2 is 1000h. 2) Register ESP = 00002000h just before the instruction call myRoutine is executed. 3) [ESP] = 00005000h just before the instruction call myRoutine is executed. Just after the instruction call myRoutine is executed, Register ESP will contain _____and [ESP] will store the double word _______.

Answer 1: 00001FFCh Answer 2: 00001000h

Offset Labels Instruction 2A60h call MyBird 2A63h xor edx, edx 2A65h mov eax,ebx 2A6Bh MyBird: mov ecx, 5 2A6Dh mov ebx,4 2A6Fh ret To execute the instruction ret, the CPU pops out the value________ from the stack and sets the register EIP to the value ________ [(provide the answers as an 8-digit hexadecimal numbers).

Answer 1: 00002A63h Answer 2: 00002A63h

Fill in multiple blanks. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction. The second column (labeled "Labels") contains the labels. The rightmost column contains the instructions. The execution starts with Register EIP = 00002A60h. Offset Labels Instruction 2A60h call MyBird 2A63h xor edx, edx 2A65h mov eax,ebx 2A6Bh MyBird: mov ecx, 5 2A6Dh mov ebx,4 2A6Fh ret When the CPU executes the instruction call MyBird, it will execute the following actions: 1) the value will be pushed onto the stack, ________ 2) the register EIP will be set to the value , ________ and 3) [ESP] will contain ________ (provide the answers as 8-digit hexadecimal numbers).

Answer 1: 00002A63h Answer 2: 00002A6Bh Answer 3: 00002A63h

Consider the following code snapshot: call myRoutine add ax, 2 We assume the following: 1) the offset of the instruction add ax, 2 is 2000h. 2) Register ESP = 00004008h just before the instruction call myRoutine is executed. 3) [ESP] = 00005000h just before the instruction call myRoutine is executed. Just after the instruction call myRoutine is executed, Register ESP will contain ________and [ESP] will store the double word_______ .

Answer 1: 00004004h Answer 2: 00002000h

Fill in multiple blanks Consider the following code snapshot: sub bx, 2 ret We assume the following: 1) the offset of the instruction sub bx, 2 is 2000h. 2) Register ESP = 00006C24h just before the instruction ret is executed. 3) [ESP] = 00003000h just before the instruction ret is executed. Just after the instruction ret is executed, Register ESP will contain _______and EIP will contain______ .

Answer 1: 00006C28h Answer 2: 00003000h

Fill in multiple blanks Consider the following code snapshot: mul bx ret We assume the following: 1) the offset of the instruction mul bx is 2000h. 2) Register ESP = 00008000h just before the instruction ret is executed. 3) [ESP] = 00005000h just before the instruction ret is executed. Just after the instruction ret is executed, Register ESP will contain _______and EIP will contain ______.

Answer 1: 00008004h Answer 2: 00005000h

Select the right option for the dropdown. Consider this code snapshot: MOV DX, 0000h MOV ECX, 04h Jolie : ADD DL, 02 ADD DH, DL LOOP Jolie Done : After the execution of the code above, Register DL will be equal to 08h .

Answer 1: 08h

Consider this code snapshot: MOV DL, 07h MOV CL, 09h CMP CL, DL JZ L1 MOV CL, 22h JMP L2 L1 : MOV CL, 33h L2: After the execution of the code above, Register CL will be equal to ______.

Answer 1: 22h

Select the right option for the dropdown. Consider this code snapshot: MOV DL, 07h MOV CL, 09h CMP CL, DL JB L1 MOV CL, 22h JMP L2 L1 : MOV CL, 33h L2: After the execution of the code above, Register CL will be equal to _______ .

Answer 1: 22h

Select the right option for the dropdown. Consider this code snapshot: MOV DL, 07h MOV CL, 09h CMP CL, DL JZ L1 MOV CL, 22h JMP L2 L1 : MOV CL, 33h L2: After the execution of the code above, Register CL will be equal to 22h .

Answer 1: 22h

Select the right option for the dropdown. Consider this code snapshot: MOV DL, 07h MOV CL, 09h CMP CL, DL JAE L1 MOV CL, 22h JMP L2 L1 : MOV CL, 33h L2: After the execution of the code above, Register CL will be equal to _______ .

Answer 1: 33h

Select the right option for the dropdown. Consider this code snapshot: MOV DL, 07h MOV CL, 09h CMP CL, DL JZ L1 MOV CL, 22h L1 : MOV CL, 33h L2: Be careful! Read carefully the code and trace the code to the end. After the execution of the code above, Register CL will be equal to 33h .

Answer 1: 33h

Select the right option for the dropdown. Consider this code snapshot: MOV DL, 09h MOV CL, 09h CMP CL, DL JZ L1 MOV CL, 22h JMP L2 L1 : MOV CL, 33h L2: After the execution of the code above, Register CL will be equal to 33h .

Answer 1: 33h

Select the right option for the dropdown. The objective is to complete this program below. You must select the right jump instruction such that the jump to Label Bird occurs if BL >= DL, assuming BL and DL contain unsigned numbers. CMP BL, DL Bird

Answer 1: JAE

Select the right option for the dropdown. The objective is to complete this program below. You must select the right jump instruction such that the jump to Label Bird occurs if BL >= DL, assuming BL and DL contain signed numbers. CMP BL, DL Bird

Answer 1: JGE

Select the right option for the dropdown. The objective is to complete this program below. You must select the right jump instruction such that the jump to Label Bird occurs if BL < DL, assuming BL and DL contain signed numbers. CMP BL, DL Bird

Answer 1: JL

Select the right option for the dropdown. The objective is to complete this program below. You must select the right jump instruction such that the jump to Label Bird occurs if BL == DL. CMP BL, DL Bird

Answer 1: JZ

Select the best answer from the dropdown menu. The CALL instruction will always ____________.

Answer 1: decrease ESP

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown: .data myDWord1 DWORD ? myWord1 WORD ? myWord2 WORD ? myDWord2 DWORD ? .code std mov eax, 12345678h mov esi, OFFSET myWord1 mov ____, eax mov edi, OFFSET myDWord2 movsd mov edx, ____

Answer 1: Answer 2: Answer 3: 12345678h Answer 4: 00000000h Answer 5: 00000004h Answer 6: 12345678h

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myTable1 is 0h. Note that arrays myTable1 and myTable2 differ by one byte as indicated in bold. .data myTable1 BYTE 0Ah,1Bh,3Dh,2Ch,4Eh,5Fh,10h,43h myTable2 BYTE 0Ah,1Bh,45h,2Ch,4Eh,5Fh,10h,43h .code std mov al,00h mov esi,OFFSET myTable1 add esi,4 mov edi,OFFSET myTable2 add edi,4 cmpsd jz Done inc al Done: After the execution of the above program, the following registers and memory cells will have the following values: esi = ____; edi = ___ ; al = _____

Answer 1: 00000000h Answer 2: 00000008h Answer 3: 00h

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of mySource is 0h. .data mySource BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h myTarget BYTE 8 DUP(?) .code std mov esi,OFFSET mySource add esi,7 mov edi,OFFSET myTarget add edi,7 mov ecx, 8 rep movsb inc esi inc edi mov al,[esi] mov dl,[edi] After the execution of the above program, the following registers and memory cells will have the following values: esi = ___; edi = ___; al = ___ ; dl = ___

Answer 1: 00000000h Answer 2: 00000008h Answer 3: 0Ah Answer 4: 0Ah

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of mySource is 0h. .data mySource BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h myTarget BYTE 8 DUP(?) .code cld mov esi,OFFSET mySource mov edi,OFFSET myTarget mov ecx, 1 rep movsd sub esi,4 sub edi,4 mov eax,[esi] mov edx,[edi] After the execution of the above program, the following registers and memory cells will have the following values: esi = ___; edi = ___; eax = ___ ; edx = ___

Answer 1: 00000000h Answer 2: 00000008h Answer 3: 3D2C1B0Ah Answer 4: 3D2C1B0Ah

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of mySource is 0h. .data mySource BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h myTarget BYTE 8 DUP(?) .code cld mov esi,OFFSET mySource mov edi,OFFSET myTarget mov ecx, 2 rep movsw sub esi,2 sub edi,2 mov ax,[esi] mov dx,[edi] After the execution of the above program, the following registers and memory cells will have the following values: esi = ___; edi = After the execution of the above program, the following registers and memory cells will have the following values: esi = ___; edi = ___; ax = ___ ; dx = ______; ax = ___ ; dx = ___

Answer 1: 00000002h Answer 2: 0000000Ah Answer 3: 3D2Ch Answer 4: 3D2Ch

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myString is 0000h. .data myString BYTE "ABC",0 myTable BYTE 41h, 42h, 43h,0 .code cld mov al,00h mov esi,OFFSET myString mov edi,OFFSET myTable mov ecx,4 repz cmpsb jz Done inc al Done: After the execution of the above program, the following registers and memory cells will have the following values: esi = ___ ; edi = ___ ; al = ___; ecx =____

Answer 1: 00000004h Answer 2: 00000008h Answer 3: 00h Answer 4: 00000000h

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myTable1 is 0h. Note that arrays myTable1 and myTable2 differ by one byte as indicated in red. .data myTable1 BYTE 0Ah,1Bh,3Dh,2Ch,4Eh,5Fh,10h,43h myTable2 BYTE 0Ah,1Bh,45h,2Ch,4Eh,5Fh,10h,43h .code cld mov al,00h mov esi,OFFSET myTable1 mov edi,OFFSET myTable2 cmpsd jz Done inc al Done: After the execution of the above program, the following registers and memory cells will have the following values: esi = ___; edi = ___; al = _____

Answer 1: 00000004h Answer 2: 0000000Ch Answer 3: 01h

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myTable1 is 0h. Note that arrays myTable1 and myTable2 differ by one byte as indicated in bold. .data myTable1 BYTE 0Ah,1Bh,3Dh,2Ch,4Eh,5Fh,10h,43h myTable2 BYTE 0Ah,1Bh,45h,2Ch,4Eh,5Fh,10h,43h .code cld mov al,00h mov esi,OFFSET myTable1 mov edi,OFFSET myTable2 mov ecx,2 repz cmpsd jz Done inc al Done: After the execution of the above program, the following registers and memory cells will have the following values: esi = _____; edi = ____; al = ___ ; ecx = ____

Answer 1: 00000004h Answer 2: 0000000Ch Answer 3: 01h Answer 4: 1

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of mySource is 0h. .data mySource BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h myTarget BYTE 8 DUP(?) .code cld mov esi,OFFSET mySource mov edi,OFFSET myTarget mov ecx, 4 rep movsw sub esi,2 sub edi,2 mov ax,[esi] mov dx, [edi] After the execution of the above program, the following registers and memory cells will have the following values: esi = ___; edi = ___; ax = ___ ; dx = ___

Answer 1: 00000006h Answer 2: 0000000Eh Answer 3: 4310h Answer 4: 4310h

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of mySource is 0h. .data mySource BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h myTarget BYTE 8 DUP(?) .code cld mov esi,OFFSET mySource mov edi,OFFSET myTarget mov ecx, 8 rep movsb dec esi dec edi mov al,[esi] mov dl,[edi] After the execution of the above program, the following registers and memory cells will have the following values: esi = ___; edi = ___; al = ___ ; dl = _____

Answer 1: 00000007h Answer 2: 0000000Fh Answer 3: 43h Answer 4: 43h

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myString is 0h. .data myString BYTE "0123456",0 myTable BYTE 30h,31h,32h,33h,34h,35h,36h,0 .code cld mov al,00h mov esi,OFFSET myString mov edi,OFFSET myTable mov ecx,4 repz cmpsw jz Done inc al Done: mov dl,myString After the execution of the above program, the following registers and memory cells will have the following values: esi = ___ ; edi = ____ ; al = ____ ; dl = ___ ; ecx =_____

Answer 1: 00000008h Answer 2: 00000010h Answer 3: 00h Answer 4: 30h Answer 5: 00000000h

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myString is 0h. .data myString BYTE "3456789",0 myTable BYTE 33h,34h,35h,36h,37h,38h,39h,0 .code cld mov al,00h mov esi,OFFSET myString mov edi,OFFSET myTable mov ecx,2 repz cmpsd jz Done inc al Done: mov dl,myString After the execution of the above program, the following registers and memory cells will have the following values: esi = ____ ; edi = ____ ; al = ___ ; dl =___ ; ecx = ___

Answer 1: 00000008h Answer 2: 00000010h Answer 3: 00h Answer 4: 33h Answer 5: 00000000h

Fill in multiple blanks. Consider this program snapshot: .data myVar BYTE 00h myTable DWORD 12h, 56h, 90h,78h We assume that the memory snapshot below starts from the offset 1000h where the data defined above will be stored. Fill in the content of each memory cell. If undetermined, fill in with the character '?' Offset Content 1000h ____________ 1001h ____________ 1002h ___________ 1003h ____________ 1004h ___________ 1005h ___________

Answer 1: 00h Answer 2: 12h Answer 3: 00h Answer 4: 00h Answer 5: 00h Answer 6: 56h

Select the right option for each dropdown. After the execution of the instruction CMP DL, DL, the Zero flag ZR will be [ Select ] ["1", "0"] , the Sign flag PL will be [ Select ] ["0", "1"] , and the Carry flag CY will be [ Select ] ["1", "0"]

Answer 1: 1 Answer 2: 0 Answer 3: 0

Fill in multiple blanks. Assume that: (ESP = 1008h) and ([ESP] = 1A343F40h) before the instruction POP EDX is executed. Fill in the blanks with the values of these registers after the execution of POP EDX: ESP = _____and EDX =_____

Answer 1: 100Ch Answer 2: 1A343F40h

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Recall that the offset of data variables starts at 0000h. In other words, the offset of myWord is 0000h. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown: .data myWord WORD ? myByte1 BYTE ? myByte2 BYTE ? .code cld mov ax,128Ah mov esi,OFFSET myWord mov [esi], ax mov edi,OFFSET myByte1 movsw mov dx,[edi] After the execution of the above program, the following registers will have the following values: ax =_____ ; esi = ____ ; edi = _____ ; dx = _____ ;

Answer 1: 128Ah Answer 2: 00000002h Answer 3: 00000004h Answer 4: Undetermined

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown: .data myDWord DWORD ? myWord1 WORD ? myWord2 WORD ? .code cld mov eax, 129B798Ah mov esi, OFFSET myDWord mov [esi], eax mov edi,OFFSET myWord1 movsdmov edx,[edi-4] After the execution of the above program, the following registers will have the following values: eax = ______ ; esi = ______ ; edi = ____ ; edx = ____ ;

Answer 1: 129B798Ah Answer 2: 00000004h Answer 3: 00000008h Answer 4: 129B798Ah

Fill in multiple blanks. Consider this program snapshot: .data myVar WORD 6712h myTable BYTE 12h, 56h, 90h,78h We assume that the memory snapshot below starts from the offset 1000h where the data defined above will be stored. Fill in the content of each memory cell. If undetermined, fill in with the character '?' Offset Content 1000h ____________ 1001h ____________ 1002h ___________ 1003h ____________ 1004h ___________ 1005h ___________

Answer 1: 12h Answer 2: 67h Answer 3: 12h Answer 4: 56h Answer 5: 90h Answer 6: 78h

Select the best answer from the dropdowns. Complete this program to count the number NC of occurrences of the double word 1B4E3D2Ch in the array myTable and to store NC in the register BL. .data myTable BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,3Dh,10h,43h,1Bh,4Eh,2Ch,3Dh .code mov eax, 1B4E3D2Ch mov edi,OFFSET ______ mov bl, _____ mov ecx, ______ myLoop : cmp eax, _____ ; jnz keepGoing inc _______ keepGoing: add edi, ______ loop myLoop

Answer 1: 1B4E3D2Ch Answer 2: myTable Answer 3: 00h Answer 4: 03h Answer 5: [edi] Answer 6: bl Answer 7: 4

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Recall that the offset of data variables starts at 0000h. In other words, the offset of myByte1 is 0000h. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown: .data myByte1 BYTE ? myByte2 BYTE ? .code cld mov al,23h mov esi,OFFSET myByte1 mov [esi], al mov edi,OFFSET myByte2 movsb mov dh,[edi-1] After the execution of the above program, the following registers will have the following values: al = ____; esi = _____; edi = _____; dh = ____ ;

Answer 1: 23h Answer 2: 00001h Answer 3: 00002h Answer 4: 23h

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Recall that the offset of data variables starts at 0000h. In other words, the offset of myByte1 is 0000h. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown: .data myByte1 BYTE ? myByte2 BYTE ? .code cld mov al,23h mov esi,OFFSET myByte1 mov [esi],al mov edi,OFFSET myByte2 movsb mov dh,[edi-1] After the execution of the above program, the following registers will have the following values: al = _____ ; esi = _____ ; edi = _____; dh = ______ ;

Answer 1: 23h Answer 2: 00001h Answer 3: 00002h Answer 4: 23h

Fill in multiple blanks. Consider this program snapshot: .data myVar 2 DUP BYTE (38h) myTable WORD 12h, 56h, 90h,78h We assume that the memory snapshot below starts from the offset 1000h where the data defined above will be stored. Fill in the content of each memory cell. If undetermined, fill in with the character '?' Offset Content 1000h ____________ 1001h ____________ 1002h ___________ 1003h ____________ 1004h ___________ 1005h ___________

Answer 1: 38h Answer 2:38h Answer 3:12h Answer 4:00h Answer 5: 56h Answer 6:00h

Fill in multiple blanks. Consider this program snapshot: .data myVar 3 DUP BYTE (47h) myTable DWORD 37h,83h,92h,40h We assume that the memory snapshot below starts from the offset 1000h where the data defined above will be stored. Fill in the content of each memory cell. If undetermined, fill in with the character '?' Offset Content 1000h ____________ 1001h ____________ 1002h ___________ 1003h ____________ 1004h ___________ 1005h ___________

Answer 1: 47h Answer 2: 47h Answer 3: 47h Answer 4: 37h Answer 5: 00h Answer 6: 00h

Select the best answer from all dropdowns. Please pay attention to these questions that are similar, sometimes differing by one instruction or even just ONE character. Recall that the offset of data variables starts at 0000h. In other words, the offset of myWord is 0000h. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown: .data myWord WORD ? myByte1 BYTE ? myByte2 BYTE ? .code std mov al,80h mov esi, OFFSET myByte1 mov [edi],al mov edi, OFFSET myByte2 movsb mov dh, [edi-1] After the execution of the above program, the following registers will have the following values: al = ___ ; esi = ____ ; edi = ___; dh = _____ ;

Answer 1: 80h Answer 2: 00000001h Answer 3: 00000002h Answer 4: 80h

Fill in multiple blanks. Suppose that the following instructions are executed in this order: 1) EBX is set 20007890h 2) BH is set to E4h Then, BX = _____h, BL = ______h, and EBX =_____ h.

Answer 1: E490 Answer 2: 90 Answer 3: 2000E490

Select the best answer from the dropdowns. Complete this program to copy 4 bytes from the array Table1 to the array Table2. .data Table1 BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h Table2 BYTE 4 DUP(?) .code mov esi,OFFSET Table1 mov edi,OFFSET ________ mov ecx, _____ Flower : mov _________ ,[esi] mov _______ , ________ ; inc ______ inc ______ _______ Flower

Answer 1: Table2 Answer 2: 4 Answer 3: al Answer 4: [edi] Answer 5: al Answer 6: esi Answer 7: edi Answer 8: loop

.data arrayFrom BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h arrayDest BYTE 8 DUP(?) .code mov esi,OFFSET arrayFrom mov edi,OFFSET _____________ mov ecx, ____________ Flower : mov __________, __________ mov [edi], ______ add esi, _____ add edi, _________ Flower

Answer 1: arrayDest Answer 2: 2 Answer 3: ebx Answer 4: [esi] Answer 5: ebx Answer 6: 4 Answer 7: 4 Answer 8: loop

elect the best answer from the dropdowns. Complete this program to copy 2 words from the array arrayFrom to the array arrayDest. .data arrayFrom BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h arrayDest BYTE 4 DUP(?) mov esi,OFFSET arrayFrom mov edi,OFFSET arrayDest mov ecx, ______ Flower : mov _____ , _____, mov [edi], _____; add esi, ______ add edi, _____ _______ Flower

Answer 1: arrayFrom Answer 2: 2 Answer 3: ax Answer 4: [esi] Answer 5: ax Answer 6: 2 Answer 7: 2 Answer 8: loop

Select the best answer from the dropdowns. Complete this program to copy all elements of the array arrayFrom to the array arrayDest. The objective is to minimize the number of loops to copy all elements of arrayFrom. .data arrayFrom BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h,4Eh,5Fh,10h,43h arrayDest BYTE 12 DUP(?) .code mov esi,OFFSET _______ mov edi,OFFSET arrayDest mov ecx, _______ Flower : mov _____ , ______ mov [edi], ______ ; add esi, ________ add edi,________ _________ Flower

Answer 1: arrayFrom Answer 2: 3 Answer 3: edx Answer 4: [esi] Answer 5: edx Answer 6: 4 Answer 7: 4 Answer 8: loop

Select the best answer from the dropdowns. Complete this program to compare the first 10 bytes of the arrays myArray1 and myArray2. The program must stop at the first difference found. If the arrays are the same, return 0 in Register bh, otherwise return 1 in bh. . data myArray1 BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h,4Eh,5Fh,10h,43h myArray2 BYTE 0Ah,1Bh,2Ch,3Dh,66h,5Fh,10h,43h,4Eh,5Fh,10h,43h .code mov esi,OFFSET myArray2 mov edi,OFFSET _______ mov ecx, _____ mov bh,0 theLoop : mov al, [edi] ______, al jz keepGoing inc ______ jmp _______ keepGoing: inc ______ inc _____ loop ______ Finished :

Answer 1: myArray1 Answer 2: 0Ah Answer 3: [esi] Answer 4: bh Answer 5: Finished Answer 6: esi Answer 7: edi Answer 8: theLoop

Select the right option for each dropdown. Consider this code snapshot: MOV DL, 07h MOV BL, 09h CMP BL, DL ----------------- After the execution of the instruction CMP BL, DL, the Zero flag ZR will be 0 , the Sign flag PL will be 0 , and the Carry flag CY will be 0

Answer 1:0 Answer 2:0 Answer 3:0

Fill in multiple blanks. Consider the following snapshot of the content of a segment. The top cell is at Offset (logical address) 0. 45h 1Eh DAh 52h 30h 41h 6Dh 11h Consider the following program: MOV ESI,2 MOV EDI,0 MOV DH,[ESI+2] MOV [EDI+1], DH After the execution of this program, the memory cell at Offset_____ will get modified and will contain the value______ .

Answer 1:1 Answer 2:30h

Fill in multiple blanks. Consider the following snapshot of the content of a segment. The top cell is at Offset (logical address) 0. 45h 1Eh DAh 52h 30h 41h 6Dh 11h Consider the following program: MOV EBX,1 MOV ECX,94DE3AB1h MOV [EBX+1],CH After the execution of this program, the memory cell at Offset_____ will get modified and will contain the value_____ .

Answer 1:2 Answer 2:3Ah

Check the best answer. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction. The second column (labeled "Labels") contains the labels. The rightmost column contains the instructions.The CPU starts executing from the instruction at Offset 2A60h. Offset Labels Instruction 2A60h call MyBird2 A63h xor edx, edx 2A65h mov eax,ebx 2A6Bh MyBird: mov ecx, 5 2A6Dh mov ebx, 4 2A6Fh ret After the CPU executes the instruction call MyBird, the value ________will be pushed onto the stack and the register EIP will be set to the value _______.

Answer 1:2A63h Answer 2:2A6Bh

Fill in multiple blanks. Consider the following snapshot of the content of a segment. The top cell is at Offset (logical address) 0. 45h 1Eh DAh 52h 30h 41h 6Dh 11h Initially, CL = 0. Consider the following program: MOV EBX,0 MOV EDX,4 MOV CL, [EBX] MOV [EDX], CL After the execution of this program, the memory cell at Offset _____will get modified and contains the value_____ . The register _____is modified and contains____ .

Answer 1:4 Answer 2:45h Answer 3:CL Answer 4:45h

Fill in multiple blanks. Consider this program snapshot: .datamyVar1 WORD 6745hmyVar2 DWORD ?myVar3 BYTE 5Ah We assume that the memory snapshot below starts from the offset 1000h where the data defined above will be stored. Fill in the content of each memory cell. If undetermined, fill in with the character '?' OffsetContent 1000h ___________ 1001h ____________ 1002h ___________ 1003h ___________ 1004h ___________ 1005h____________ 1006h____________ 1007h____________

Answer 1:45h Answer 2:67h Answer 3:? Answer 4:? Answer 5:? Answer 6:? Answer 7:5Ah Answer 8:?

Fill in multiple blanks. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction. The second column (labeled "Labels") contains the labels. The rightmost column contains the instructions. The CPU starts executing the instruction at Offset 5E30h. Offset Labels Instruction 5E30h call MyBird 5E33h xor edx, edx 5E35h MyBird: mov eax,ebx 5E3Bh mov ecx, 55E3Dh mov ebx, 45E3Fh ret To execute the instruction ret, the CPU pops out the value________ from the stack and sets the register EIP to the value_______ .

Answer 1:5E33h Answer 2:5E33h

Fill in multiple blanks. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction. The second column (labeled "Labels") contains the labels. The rightmost column contains the instructions. The CPU starts executing the instruction at Offset 5E30h. Offset Labels Instruction 5E30h call MyBird 5E33h xor edx, edx 5E35h MyBird: mov eax,ebx 5E3Bh mov ecx, 55E3Dh mov ebx, 45E3Fh ret After the CPU executes the instruction call MyBird, the value ________ will be pushed onto the stack and the register EIP will be set to the value________ .

Answer 1:5E33h Answer 2:5E35h

Select the best answer from all dropdowns. Complete the declaration/definition of this string of characters (using ASCII). .data mySalut ______ "Bonjour!", ________

Answer 1:BYTE Answer 2:0

Fill in multiple blanks. Consider this program snapshot: .data myVar1 DWORD 1234ABCDh myVar2 WORD 0FF45h myVar3 BYTE 5Ah We assume that the memory snapshot below starts from the offset 1000h where the data defined above will be stored. Fill in the content of each memory cell. If undetermined, fill in with the character '?' Offset Content 1000h ____________ 1001h ____________ 1002h ___________ 1003h ____________ 1004h ___________ 1005h ___________ 1006h ___________ 1007h __________

Answer 1:CDh Answer 2:ABh Answer 3:34h Answer 4:12h Answer 5:45h Answer 6:FFh Answer 7:5Ah Answer 8:?

Select the best answer from the dropdowns. Complete this program to copy all double words from the array arrayFrom to the array arrayDest. .data arrayFrom BYTE 0Ah,1Bh,2Ch,3Dh,4Eh,5Fh,10h,43h arrayDest BYTE 8 DUP(?) .code mov esi,OFFSET arrayFrom mov edi,OFFSET ______ mov ecx, ____ Flower : mov ebx , _____ mov [edi], _____ add esi,____ add edi,_____ loop Flower

Answer 1:arrayDest Answer 2:2 Answer 3:ebx Answer 4:[esi] Answer 5:ebx Answer 6:4 Answer 7:4 Answer 8:loop

Check all that apply. These registers cannot be used to contain an offset for the indirect addressing mode

Any segmentation register CS DS

Check all that apply. Check the jump instructions that are unconditional.

CALL RET JMP

Check all that apply. The 32-bit MUL (multiplication) instruction uses implicitly these registers

EAX EDX

Select the best answer. On x86 processor, the code of a routine interrupt handler must end with the instruction _______.

IRET

Check all that apply. Check the jump instructions that are conditional.

JZ JC

Check all that apply. Consider the following procedure designed to copy an 8-byte array A onto array B. The offsets for the arrays A and B are provided in the registers ESI and EDI, respectively. Below is the code of the procedure. arrayCopy PROC mov ecx, 8 myLoop : mov al, [esi] mov [edi], al inc esi inc edi loop myLoop ret arrayCopy ENDP Check all registers that are result registers.

None of these registers

Matching. Consider the following procedure designed to copy an n-byte array A onto array B. The number of bytes in the array A is provided in Register CL. The offsets for the arrays A and B are provided in the registers ESI and EDI, respectively. Below is the code of the procedure. arrayCopy PROC ------- ; Statement 1 ------- ; Statement 2 ------- ; Statement 3 ------- ; Statement 4 and ecx, 0FFh myLoop : mov al, [esi] mov [edi], al inc esi inc edi loop myLoop pop esi pop edi pop ecx pop ax ret arrayCopy ENDP Match the appropriate instructions to statements Statement 1, Statement 2, Statement 3, and Statement 4 at the beginning of the procedure.

Statement 1 push ax Statement 2 push ecx Statement 3 push edi Statement 4 push esi

Select the best answer. Check the correct statement to define a 16-bit variable Sum that is not initialized.

Sum WORD ?

The POP instruction increments ESP after popping out the item from the stack.

TRUE

The PUSH instruction decrements ESP before storing the operand on the stack.

TRUE (after storing, says it's true in quiz but i think this is an error)

Select the best answer. Check the correct statement to define an 8-bit variable Total that is not initialized.

Total BYTE ?

Check all that apply. Check all correct data definition statements.

aWord BYTE 4Ch ; this is a byte avar3 SDWORD 12h avar1 BYTE ?

Check all that apply. Consider this program: mov ebx, 2 add ebx, ecx The instruction add ebx,ecx will modify some register(s). Check all register(s) that will get modified by the instruction add ebx,ecx.

ebx EIP

Check all that apply. Consider the following procedure designed to copy an n-byte array A onto array B. The number of bytes in the array A is provided in Register CL. The offsets for the arrays A and B are provided in the registers ESI and EDI, respectively. Below is the code of the procedure. arrayCopy PROC and ecx, 0FFh myLoop : mov al, [esi] mov [edi], al inc esi inc edi loop myLoop ret arrayCopy ENDP Check all registers that are intermediary registers.

ecx al

Check all that apply. Consider the following procedure designed to copy an 8-byte array A onto array B. The offsets for the arrays A and B are provided in the registers ESI and EDI, respectively. Below is the code of the procedure. arrayCopy PROC mov ecx, 8 myLoop : mov al, [esi] mov [edi], al inc esi inc edi loop myLoop ret arrayCopy ENDP Check all registers that are parameter registers.

esi edi

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myTable1 is 0h. Note that arrays myTable1 and myTable2 differ by one byte as indicated in red. .data myTable1 BYTE 0Ah,1Bh,3Dh,2Ch,4Eh,5Fh,10h,43h myTable2 BYTE 0Ah,1Bh,45h,2Ch,4Eh,5Fh,10h,43h .code cld mov al,00h mov esi,OFFSET myTable1 mov edi,OFFSET myTable2 cmpsb jz Done inc al Done: After the execution of the above program, the following registers and memory cells will have the following values: esi = 00000001h ; edi = 00000009h ; al = 00h ;

esi = 00000001h ; edi = 00000009h ; al = 00h ;

Select the best answer from all dropdowns. Trace (i.e., execute manually) the following program, then select the best answer from each dropdown. Assume that the offset of myTable1 is 0h. Note that arrays myTable1 and myTable2 differ by one byte as indicated in bold. .data myTable1 BYTE 0Ah,1Bh,3Dh,2Ch,4Eh,5Fh,10h,43h myTable2 BYTE 0Ah,1Bh,45h,2Ch,4Eh,5Fh,10h,43h .code std mov al,00h mov esi,OFFSET myTable1 add esi,4 mov edi,OFFSET myTable2 add edi,4 cmpsw jz Done inc al Done: After the execution of the above program, the following registers and memory cells will have the following values: esi = 00000002h ; edi = 0000000Ah ; al = 00h ;

esi = 00000002h ; edi = 0000000Ah ; al = 00h ;

Check the best answer. Consider this program listed on this table. The first (leftmost) column contains the offset of the instruction. The second column (labeled "Labels") contains the labels. The rightmost column contains the instructions.The CPU starts executing from the instruction at Offset 2A60h. Offset Labels Instruction 2A60h call MyBird2 A63h xor edx, edx 2A65h mov eax,ebx 2A6Bh MyBird: mov ecx, 5 2A6Dh mov ebx, 4 2A6Fh ret Just after the CPU executes the instruction call MyBird, the next instruction that will be executed is _________________.

mov ecx, 5

Check the best answer. Complete this definition of the EIP Register. The EIP register contains the offset of the ____________________.

next instruction to be executed

Check all that apply. Consider the following procedure designed to copy an n-byte array A onto array B. The number of bytes in the array A is provided in Register CL. The offsets for the arrays A and B are provided in the registers ESI and EDI, respectively. Below is the code of the procedure. arrayCopy PROC and ecx, 0FFh myLoop : mov al, [esi] mov [edi], al inc esi inc edi loop myLoop ret arrayCopy ENDP Check all statements that must be put at the beginning of the procedure to make it robust.

push esi push ax push edi push ecx


Ensembles d'études connexes

Leading Marines - The Promotion System

View Set

Chapter 9: Customer-Defined Service Standards

View Set

French 2 U3L3 -re Verbs (conjugations)

View Set

Personal Finance Module 3 Review

View Set

ATI Learning System 3.0 - Fundamentals 2

View Set

General Psychology Quiz 1 Ch 1-3

View Set

Társas képességek fejlesztése (alapok) igaz - hamis

View Set