News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

mov eax,[eax] problem

Started by thomasantony, March 30, 2005, 06:29:51 AM

Previous topic - Next topic

thomasantony

Hi,
  I get this error with mov eax,[eax]

error A2070: invalid instruction operands

This happens when I use it in winasm. I made a small test.asm file and compiled it from the console and it worked Ok. Can someone tell me whtas wrong? The whole log of winasm IDE is this



C:\masm32\Bin\ML /c /coff /Cp /nologo /I"C:\masm32\Include" "C:\Projects\Masm32\Mx Lookup\mx.asm"

Assembling: C:\Projects\Masm32\Mx Lookup\mx.asm
C:\Projects\Masm32\Mx Lookup\mx.asm(208) : error A2070: invalid instruction operands

C:\masm32\Bin\Link @"C:\Projects\Masm32\Mx Lookup\link.war"

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/SUBSYSTEM:CONSOLE /RELEASE /VERSION:4.0 "/LIBPATH:c:\masm32\Lib" "C:\Projects\Masm32\Mx Lookup\mx.obj" "/OUT:C:\Projects\Masm32\Mx Lookup\mx.exe"
LINK : fatal error LNK1181: cannot open input file "C:\Projects\Masm32\Mx Lookup\mx.obj"

Make finished. 2 error(s) occured

But when I compile this specific file in console also I get this error. Whats wrong? I stop getting the error if I do
mov eax,dword ptr[eax]

Thomas Antony
::)
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

thomasantony

Hi,
  I found out the problem right away. Stupid of me :red . I had used assume on eax making it as a pointer to a structure. It started working okay when I did :

assume eax:nothing

Thomas Antony :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

MichaelW

You will get the same error with:

assume eax:ptr byte

And  "error A2022: instruction operands must be the same size" with:

assume eax:ptr word


eschew obfuscation