Search code examples
assemblyx86masm32

x86 assembly extreme novice inquiry: "invalid instruction operands"?


The code below is only a small fraction of the program I am currently attempting to write, but no other parts of the program are relevant, so I only pasted what was necessary. Anyway, what I am trying to do is move the value stored within inputLoopCounter into ecx in order to determine how many times a loop should execute. However, when I attempt to assemble this program, I get the error mentioned in the question title. Can anybody explain the reason for this?

.data
inputLoopCounter BYTE -1

.code
mov   ecx,inputLoopCounter

Solution

  • One possible solution would be to replace inputLoopCounter BYTE -1 by inputLoopCounter DWORD -1.