QuestionQuestion

Write a procedure named Str_concat that concatenates a source string to the end of a target string. Sufficient space must be available in the target string before this procedure is called. Pass pointers to the source and target strings like this:
INVOKE Str_concat, ADDR targetStr, ADDR sourceStr

You have to enter two strings and the output will be
Enter a string: abcde
Enter a string: 123
The string concatenated: abcde123
Press any key to continue . . .
Attention to:
Using PROC with parameters makes a clear calling interface. Don't pass any register argument to Str_concat
A string length calculation should be wrapped into Str_concat logic based on the parameters
The null terminator must be considered in Str_concat without relying on outside memory initializations

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

main PROC
mov edx, OFFSET out1; print "Input a string"
call WriteString
mov edx, OFFSET str1; Read console input into str1
mov ecx, MAXLEN; limit the input size
call ReadString
mov edx, OFFSET out1; print "Input a string"
call WriteString
mov edx, OFFSET str2; Read console input into str1
mov ecx, MAXLEN; limit the input size
call ReadString
mov edx, OFFSET out2; Print "The concatenated string "
call WriteString
Invoke Str_concat, ADDR str1, ADDR str2; call Str_concat procedure
mov edx, OFFSET str1; Print the concatenated string
call WriteString
call Crlf
call waitMsg
Invoke ExitProcess, 0...

By purchasing this solution you'll be able to access the following files:
Solution.asm.

$9.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats