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? WhatExplanation / 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"'
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.