I wish to have 2 user inputs. For example 8 and 3. Then I would to multiply them with the variable f1 and f2 so 8 x f1 and 3 x f2. Then I would like to add them so (8 x f1) + (3 x f2). I do not know how to multiply the user input with the variable and finally adding them together
;TITLE Multiply input with number then add them
.model small
.stack 100
.data
f1 DB 10
f2 DB 20
msg1 DB 13,10,"First input = $" ;--ask user to input 1 digit. Example = 8
msg2 DB 13,10,"Second input = $" ;--ask user to input 1 digit. Example = 3
msg3 DB 13,10,"Product = $" ;--multiply the first and second input with f1 and f2. So 8x10 and 3x20
msg4 DB 13,10,"Addition = $" ;--Add those numbers that have been multiplied to 80 + 60 = 140
q1 DB ? ;user inputs
q2 DB ?
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx, msg1
int 21h
mov ah,01h
int 21h
sub al,30h
mov q1,al
;--multiplication of 1st user input with f1 here but idk how
mov ah,09h
lea dx, msg2
int 21h
mov ah,01h
int 21h
sub al,30h
mov q2,al
;--multiplication of 2nd user input with f2 here but idk how
mov ah,09h
lea dx, msg4
int 21h
;--Addition of those 2 multiplied numbers here
mov ah, 4Ch
int 21h
main endp
end main