I'm making a program where the user enters a number, it the program prints out from zero to that number. Here is my code:
SECTION .DATA
len EQU 32
SECTION .bss
data resw len
other resw len
SECTION .TEXT
GLOBAL _start
_start:
input: ; This section gets the integer from the user
mov eax, 3 ; }
mov ebx, 1 ; }
mov ecx, data ; } System_read call
mov edx, len ; }
int 80h ; }
prelim:
mov ebp, 0
setup: ; This section sets up the registers ready for looping
push ebp
pop other ; THIS IS THE ERROR LINE!
mov esi, data
loop: ; This section loops, printing out from zero to the number given
mov eax, 4
mov ebx, 1
mov ecx, other
mov edx, len
int 80h
cmp ebp, esi
je exit
inc ebp
jmp setup
exit: ; Exits the program
mov eax, 1 ; }
mov ebx, 0 ; } System_exit call
int 80h ; }
The problem I am having is that it gives the error invalid combination of opcode and operand. I have tried declaring the variable other a word, double word, byte, and it still says that. Why does it?
In essence, my question is how can I move a value in a register to a value in memory? Such as:
mov memorydata, eax
Where memorydata is data declared in SECTION .data or something of the like.