'Assembly concatenate
I'm new to assembly, I have 3 variables, str1 str2 str3. The program will ask the user for a string input and store it in str1 and str2 and for str3, it contains the concatenated value of str1 and str2, is there anyway to do this? this is my code.
.model small
.stack
.data
msg1 db 13,10,"Enter a string>> $"
msg2 db 13,10,"Concatenated: $"
str3 db 20 dup(?),"$"
v1 label byte
v2 db 11
v3 db 0
str1 db 11 dup("#")
g1 label byte
g2 db 11
g3 db 0
str2 db 11 dup("@")
.code
mov ax,@data
mov ds,ax
mov ah,9
lea dx, msg1 ;;PROMPTS INPUT
int 21H
mov ah, 0AH ;;ACCEPTS STRING INPUT
lea dx, v1 ;;stores in 1st container = v1
int 21H
mov ah, 0AH ;;ACCEPTS STRING INPUT
lea dx, v2 ;;stores in 2st container = v2
int 21H
mov ah,4ch
int 21h
END
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
