Question: Use the following data declaration to write an assembly language loop that copies the string from source to target. source BYTE String to be copied,

Use the following data declaration to write an assembly language loop that copies the string from source to target.

source BYTE "String to be copied", 0

target BYTE SIZEOF source DUP(0), 0

I have done the work but just want to ask which of the following are correct and why or why not.

First implementation:

mov edi, 0

mov ecx, SIZEOF source

L1:

mov al, source[edi]

mov target[edi], al

inc edi

loop L1

Second implementation:

mov ecx, SIZEOF source

L1:

mov edi, OFFSET source

mov al, [edi]

mov target, al

inc edi

loop L1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!