Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

12. (10 pts) Consider the code below: (I cut out some pieces for brevity) Commen

ID: 3911441 • Letter: 1

Question

12. (10 pts) Consider the code below: (I cut out some pieces for brevity) Comment each of the groups of code
above the blank line. Looking for 1 – 3 sentence descriptions, so include as much detail as you can. No need
to comment each line, don’t care, want to know what the code does collectively.


StartOfLoop:
004019B6 8B 45 F8 mov eax, [ebp-8]
004019B9 83 C0 01 add eax, 1
004019BC 89 45 F8 mov [ebp-8], eax


; (1 pt) ________________________________________________
004019BF 8B 4D F8 mov ecx, [ebp-8]
004019C2 3B 4D 0C cmp ecx, [ebp+0Ch]
004019C5 7D 36 jge EXIT


; (3 pts) ________________________________________________
004019CD 0F BE 02 movsx eax, byte ptr [edx]
004019D6 0F BE 11 movsx edx, byte ptr [ecx]
004019D9 33 C2 xor eax, edx
004019E1 88 01 mov [ecx], al


; (3 pts) ________________________________________________
004019EC 8B 45 FC mov eax, [ebp-4]
004019EF 3B 45 14 cmp eax, [ebp+14h]
004019F2 75 07 jnz 0x4019FB
004019F4 C7 45 FC 00 00 00 00 mov [ebp-4], 0


; (3 pts) ________________________________________________
004019FB EB B9 jmp StartOfLoop


; (0 pts) _jumps to beginning of loop_

Explanation / Answer

The explanation for each group is given below:

1. The explanation of group one:

2. The explanation of group two:

3. The explanation of group three:

4. The explanation of group four: