Hi, i have one question, how to work with 2characters(or more) number? for example 15 5 how to add 15+5 subtract 15-5 multiply 15*5 and div 15/5 to get proper answer from user input? Because how to work with single numbers i figure it out, but when the answer goes to 2digits i get some weird characters( i think they are ASCII characters) here is my code:
section .data
msg:db"First: "
msg_L: equ $-msg
br:db"",10
br_L: equ $-br
msg2:db"Second: "
msg2_L: equ $-msg2
section .bss
First resb 255
Second resb 255
Sum resb 255
section .text
global _start
_start:
mov eax,4 ;Propmpts to enter 1st num
mov ebx,1
mov ecx,msg
mov edx,msg_L
int 80h
mov eax,3 ;gets user first number
mov ebx,1
mov ecx,First
mov edx,255
int 80h
mov eax,4 ;break line
mov ebx,1
mov ecx,br
mov edx,br_L
int 80h
mov eax,4 ;propmpts to enter 2nd number
mov ebx,1
mov ecx,msg2
mov edx,msg2_L
int 80h
mov eax,3;gets users second number
mov ebx,1
mov ecx,Second
mov edx,255
int 80h
mov eax,4 ;break
mov ebx,1
mov ecx,br
mov edx,br_L
int 80h
;////////////////////////////////////////////
mov al,[First] ;moving to al register
mov bl,[Second] ;moving to bl register
sub al,'0'
sub bl,'0'
add al,bl
add al,'0'
mov [Sum],al ;seting Suma to al
;///////////////////////////////////////////////
mov eax,4;showing the answer
mov ebx,1
mov ecx,Sum
mov edx,255
int 80h
mov eax,4
mov ebx,1
mov ecx,br
mov edx,br_L
int 80h
mov eax,1
mov ebx,0
int 80h
This works if first second and sum numbers are only 1 digits.But how to do with multiple digits?