Question

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 Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse 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...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Assembly Language Problems
Homework Solution
$50.00
Programming
Computer Science
Assembly Language
Characters
Calendars
Video Mode
Variables
Keyboard Navigation
Commands
Assembly & Data Representation Questions
Homework Solution
$18.00
Mantissa
Sign
Bit
Exponent
Infinity
Assembly
Language
Binary
Instruction
Register
Ebx
Ecx
Edx
Memory
Location
Content
C
Statement
Equivalent
x86 Assembly Language Questions about Registers and Flags
Homework Solution
$8.00
X86
Assembly
Register
Flag
Mode
ESP
CPU
Stack
Status
Variable
Unsigned
Signed
Arithmetic
Operation
Bit
Floating
Point
Data
Negative
Positive
Base
Pointer
Carry
EBP
Interrupt
Signal
Error
FP
Overflow
Underflow
Direction
Trap
Iterative Factorial Calculation in Assembly
Homework Solution
$10.00
Computer Science
Programming
Iterative Factorial Calculation
Assembly Language
Loops
Functions
Input
Output
Procedures
Error Conditions
Get help from a qualified tutor
Live Chats