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

1 Eor the following exercises, assume that the data segment contains: source BYT

ID: 3829724 • Letter: 1

Question

1 Eor the following exercises, assume that the data segment contains: source BYTE "brown" dest BYTE "brine" a) Suppose that the following instructions are executed: lea esl, source lea edi, dest mov ecx, 5 repne ampsb Assuming that 00417000 is the address loaded in ESI and 00417005 is loaded in EDI, what will be the values stored in ESI and EDI following the repne cmpsb instruction? b) Suppose that the following instructions are executed: lea esi, source lea edi dest mov ecx, 3 rep movsb Assuming that 00417000 is the address loaded in ESI and 00417005 is loaded in EDI, what will be the values stored in ESI and EDI following the rep movsb instruction? What

Explanation / Answer

b ) has movsb which means thaat -

Copy byte at DS:[SI] to ES:[DI]. Update SI and DI.

cld would set df=0 therefore, SI and DI proceed in the direction of increasing memory addresses

EDI will have 00417005, ESI 00417000

ECX will have 3 stored in it.

destination string will have the first byte of the source string in it , hence it now contains only "b"'