I'm trying to make a program that gets two input numbers, multiplies them (storing the result in a variable), divides them (storing the result in another variable) and prints the result.
The issue I'm having is that the first line of code push num1
returns invalid instruction operands
:
.data
num1 db "Enter a number:"
num2 db "Enter another number:"
.data?
buffer1 dd 100 dup(?) ; this is where I store input for num1
buffer2 dd 100 dup(?) ; " " num2
.code
start:
push num1 ; here is where it returns the error
call StdOut ;I want to print num1 but it doesn't get that far.
; later on in my code it does multiplication and division.
push buffer1 ; I push buffer1
call StdIn ; so that I can use it for StdIn
; I repeat this for num2
; I then use those 2 numbers for multiplication and division.
Why is it causing this error?
invalid instruction operands
using this code:mov eax, num1 ; the variable is num1
. Why is this? – Frigidarium