Answered step by step
Verified Expert Solution
Question
1 Approved Answer
VS 2017 (C/C++) / Assembly language / INCLUDE Irvine32.inc Copy_a_String_Backwards (Chapter 4, Pr 7, Modified) Write a program using the LOOP instruction with indirect operands
VS 2017 (C/C++) / Assembly language / INCLUDE Irvine32.inc
Copy_a_String_Backwards (Chapter 4, Pr 7, Modified) Write a program using the LOOP instruction with indirect operands (not indexed operands) that copies a string from source to target, reversing the character order in the process. Don't use PUSH/POP at this time. Referring to the CopyStr.asm, your algorithm can be like this Point ESI to the end of the source string Point EDI to the beginning of the target string Initialize the loop counter ECX and start a loop o Get a character from source o Store it in the target o Update ESI and ED Make a terminator at the end of the target in your code logic. Don't rely on the target initialization Call WriteString to output the two strings similar to this: Original: This is the source string Reversed: gnirts ecruos eht si sihT Altenative solution: A little challenging while more efficient is in-place reversing a string: what if using xchgStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started