I was wondering if anyone could help me with this program. It asks two values and then add them.
The problem is that this program does not show the result.
I write this code:
Code: Select all
section .bss
num1 resb 1
num2 resb 1
section .text
global _start
_start:
; Get first number
mov eax,3
mov ebx,0
mov ecx,num1
mov edx,2
int 80h
;Get second number
mov eax,3
mov ebx,0
mov ecx,num2
mov edx,2
int 80h
;Add both values
mov ecx,[num1]
add ecx,[num2]
;Print the result
mov eax,4
mov ebx,1
mov edx,2
int 80h
;Close the program
mov eax,1
mov ebx,0
int 80h