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
Get step-by-step solutions from verified subject matter experts
