Question: The following code copies a string from source to target: .data source BYTE This is the source string,0 target BYTE SIZEOF source DUP(0) .code mov

The following code copies a string from source to target:

.data

source BYTE "This is the source string",0

target BYTE SIZEOF source DUP(0)

.code

mov esi,0 ; index register

mov ecx,SIZEOF source ; loop counter

L1:

mov al,source[esi] ; get char from source

mov target[esi],al ; store it in the target

inc esi ; move to next character

loop L1 ; repeat for entire string

mov edx, OFFSET source

call WriteString

mov edx, OFFSET target

call WriteString

Rewrite the program using indirect addressing rather than indexed addressing. [Hint] Use OFFSET operator to save the base address of source and target.

provide asm file

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!