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

I\'ve tried different solutions but I can\'t get them to function correctly. You

ID: 3779779 • Letter: I

Question

I've tried different solutions but I can't get them to function correctly.

You need to modify the class example "Copying a String" at the end of the Assembly Language II lecture. You need to modify the example program so it copies from the end of the source string and stores the copied values starting at the beginning of the target (destination) string. The target string should be the reversed version of the source string. For example, the program should take a source string of "RCGC CSC203" and create a target string "302CSC CGCR".

Requirements:

Display source string on the screen.

Use a LOOP instruction to build a loop used to copy a character at a time from the source to the destination.

Finally, display the target (destination) string on the screen.

Example: Copying a String .data source BYTE "This is the source string", 0 target BYTE SIZEOF source DUP(0) code set the index MOV esi, 0 Mov ecx IZEOF source set the loop count L1 ;get a single char at the current array index MOV a source Resil Mov targetlesil, al ;store the char at the same index of target INC esi ;move to the next character LOOP L1

Explanation / Answer

Below is the code for your requirement. you need to use this logic:

i=last index value of source;
j= first index value

loop
{  
copy the charater frrom source[i] to target[j]
decrement i
increment j
}

code ::

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote