Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following code copies a c-string in MASM Modify it to include another string, initialized with the value This is the appended string,0. Then append

image text in transcribed

The following code copies a c-string in MASM Modify it to include another string, initialized with the value "This is the appended string",0. Then append this string to the source string into the, appropriately sized, target string. Display the contents of the resulting string using the DumpMem call Provide the Ist file as well as a screenshot of the run together in a zip file TITLE Copying a String (CopyStr.asm) ; This program copies a string ; Last update: 2/1/02 INCLUDE Irvine32.inc data source BYTE "This is the source string",0 target BYTE SIZEOF source DUP(0),0 .code main PROC mov esi,0 mov ecx,SIZEOF source ; index register loop counter L1 : mov al,source[esi] ;get a character from source mov target[esi],al store it in the target inc esi loop L1 ; move to next character ; repeat for entire string exit main ENDP END main The following code copies a c-string in MASM Modify it to include another string, initialized with the value "This is the appended string",0. Then append this string to the source string into the, appropriately sized, target string. Display the contents of the resulting string using the DumpMem call Provide the Ist file as well as a screenshot of the run together in a zip file TITLE Copying a String (CopyStr.asm) ; This program copies a string ; Last update: 2/1/02 INCLUDE Irvine32.inc data source BYTE "This is the source string",0 target BYTE SIZEOF source DUP(0),0 .code main PROC mov esi,0 mov ecx,SIZEOF source ; index register loop counter L1 : mov al,source[esi] ;get a character from source mov target[esi],al store it in the target inc esi loop L1 ; move to next character ; repeat for entire string exit main ENDP END main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions