(Preliminary information: As a newbie I managed to do a one digit calculator finally, but to do a multi-digits calculator I had to get some 'inspiration' from the internet as it is seen in the code.) The problem is when I hardcoded the input numbers calculator works perfectly ok. But when I try to get inputs from the users results are totally chaotic. I am working on this issue to solve it for almost 3 days but no solution. If anyone can help me I d be really appreciated. Thank you everyone
section .data
msg2        db      'Enter the first number: ',0xA,0xD
lmsg2       equ     $- msg2
msg3        db      'Enter the second number: ',0xA,0xD
lmsg3       equ     $- msg3
msg9        db      10,'Result= ',0
lmsg9       equ     $- msg9
section .bss
; Spaces reserved for storing the values provided by the user.  
num1       resd    4   ;;;;;;;;;;;UPDATED
num2       resd    4   ;;;;;;;;;;;UPDATED
result     resd    8   ;;;;;;;;;;;UPDATED
result_len  resd   1   ;;;;;;;;;;;UPDATED
section .text
global _start
_start:
; Print on screen the message 2
mov eax, 4
mov ebx, 1
mov ecx, msg2
mov edx, lmsg2
int 80h
; We get num1 value.
mov eax, 3
mov ebx, 0
mov ecx, num1
mov edx, 4
int 80h
; Print on screen the message 3
mov eax, 4
mov ebx, 1
mov ecx, msg3
mov edx, lmsg3
int 80h
; We get num2 value.
mov eax, 3
mov ebx, 0
mov ecx, num2
mov edx, 4
int 80h
mov eax, 12 ;;;;;;;[num1]  WHEN BEING PUT A NUMBER DIRECTLY IT WORKS
mov ebx, 55 ;;;;;;;;[num2] UPDATED- WHEN BEING PUT A NUMBER DIRECTLY IT WORKS
; Convert from ascii to decimal
  sub eax, '0'  ;;;;;;;;;;; UPDATED- COMMENTED OUT 
  sub ebx, '0'  ;;;;;;;;;;; UPDATED- COMMENTED OUT 
; Add
add eax, ebx
; Conversion from decimal to ascii
add eax, '0'   ;;;;;;;;;;; UPDATED- COMMENTED OUT 
; THIS IS THE AREA PROBLEMS HAPPEN
mov edi, result                ;  argument: Address of the target string 
call int2str                ; Get the digits of EAX and store it as ASCII
sub edi, result                ; length of the string
mov [result_len], edi
; Output "The sum is: "
mov eax, 4
mov ebx, 1
mov ecx, msg9
mov edx, lmsg9
int 0x80
; Output sum
mov eax, 4
mov ebx, 1
mov ecx, result
mov edx, [result_len]     ;;;;;;;;;;;UPDATED
int 0x80
; Exit code
mov eax, 1
mov ebx, 0
int 0x80
;LOOPS FOR DOING THE MULTI DIGITS OPERATION
int2str:    ; Converts an  integer in EAX to a string pointed to by EDI
xor ecx, ecx                  
mov ebx, 10
.LL1:                   ; First loop: Save the remainders
xor edx, edx            ; Clear EDX for div
div ebx                 ; EDX:EAX/EBX -> EAX Remainder EDX
push dx                 ; Save remainder
inc ecx                 ; Increment push counter
test eax, eax           ; Anything left to divide? 
jnz .LL1                ; if Yes: loop once more.. jump if not zero
.LL2:                   ; Second loop: Retrieve the remainders
pop dx                  ; In DL is the value
or dl, '0'              ; To ASCII
mov [edi], dl           ; Save it to the string  (
inc edi                 ; Increment the pointer to the string
loop .LL2               ; Loop ECX times
mov byte [edi], 0       ; Termination character
ret                     ; RET: EDI points to the terminating NULL
