So I have a string where I want to add more to it according to user input. For example, the string's default is "The two numbers from input are: $" , and once the user inputs 2 numbers, lets say 21 and 42, then the String should change to "The two numbers from input are: 21 42" so that I can write them into a file. Here is my code:
.model small
.stack 100
.data
Num1 DB ? ;input
Num2 DB ?
text db "The two numbers from input are: $" ;This is the string I want to change according to input
filename db "decimal.txt",0
handler dw ?
.code
START:
mov ax,@data
mov ds,ax
;////////////////////////////
;INPUT1
;Get tens digit
MOV ah, 1h
INT 21h
SUB al,30h
MOV dl, al
;Multiply first digit by 10 (tens)
MOV cl, al
MOV ch, 0
MOV bl, 10
MUL bl
MOV Num1, al
;Get ones digit
MOV ah, 1h
INT 21h
SUB al,30h
MOV dl, al
ADD Num1, dl
;INPUT2
;Get tens digit
MOV ah, 1h
INT 21h
SUB al,30h
MOV dl, al
;Multiply first digit by 10 (tens)
MOV cl, al
MOV ch, 0
MOV bl, 10
MUL bl
MOV Num2, al
;Get ones digit
MOV ah, 1h
INT 21h
SUB al,30h
MOV dl, al
ADD Num2, dl
;//////////////////////////
;FILE
;create file
MOV ah, 3ch
MOV cx, 0
MOV dx, offset filename
INT 21h
;file handler
MOV handler, Ax
;write string
MOV ah, 40h
MOV Bx, handler
MOV Cx, 50 ;string length
MOV Dx, offset text
INT 21h
MOV Ax, 4c00h
INT 21h
end start
Is there any way to do it? I tried to search on the internet but all I keep getting is concatination of two strings, which wasn't useful because I don't know how to change my input into string.