The code compiles and runs. For some reason though it will only let me input one number my symbol to perform the calculation and then closes before I can put in another number. I'm trying to get the programs to output as the following
3
+
2
=
5
This is my NASM code so far:
segment .data
num1: db 4
num2: db 4
button: db 2
segment .bss
segment .text
global asm_main
asm_main:
push ebp
mov ebp, esp
----------- CODE STARTS HERE -----------------
call read_int
mov DWORD[num1], eax
call read_char
mov DWORD[button], edx
call read_int
mov DWORD[num2], eax
cmp DWORD[button], '+'
jne addition
cmp DWORD[button], '-'
je subtraction
cmp DWORD[button], '*'
je multiplication
cmp DWORD[button], '/'
je division
cmp DWORD[button], '%'
je modulus
addition:
mov eax, DWORD[num1]
add eax, DWORD[num2]
call print_int
jmp end
subtraction:
jmp end
multiplication:
jmp end
division:
jmp end
modulus:
jmp end
end: