Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 xchg

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

Does it highlight your accomplishments rather than your duties?

Answered: 1 week ago