Im trying to add two numbers together but receive an error
How do I bypass this error? In my input I'm just adding 1+1 (no spaces), is the problem due to the reserved bites for the result variable? The assignment calls for addition between three numbers yet I cannot get past simple addition between two numbers, please help
section .data
msg db 'This program will calculate addition and subtration',0xa
len equ $ - msg ;length of our dear string
section .bss
num1 resb 1
operation resb 1
num2 resb 1
result resb 1
section .text
global _start
_start:
;print message
mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, len
int 0x80
;read first number
mov eax, 3
mov ebx, 0
mov ecx, num1
mov edx, 1
int 0x80
;print first number
mov eax, 4
mov ebx, 1
mov ecx, num1
mov edx, 1
int 0x80
;read first operation
mov eax, 3
mov ebx, 0
mov ecx, operation
mov edx, 1
int 0x80
;print first operation
mov eax, 4
mov ebx, 1
mov ecx, operation
mov edx, 1
int 0x80
;read second number
mov eax, 3
mov ebx, 0
mov ecx, num2
mov edx, 1
int 0x80
;print second number
mov eax, 4
mov ebx, 1
mov ecx, num2
mov edx, 1
int 0x80
mov ax, num1
mov bx, num2
ADD ax, bx
mov ax, result
int 0x80
;move ax to a variable
;print result
mov eax, 4
mov ebx, 1
mov ecx, result
mov edx, 1
int 0x80
mov eax, 1 ;system call number (sys_exit)
int 0x80 ;call kernel