Why does Visual Studio compile mov eax, [edx] [ebx] [ecx] [edi] without complaint?

In Visual Studio, I wrote:

mov eax, [edx][ebx][ecx][edi] 

But he is going just fine.

Why is this an invalid effective address?

+6
source share
1 answer

This seems to be a bug in later versions of MASM.

Using the following file as an example:

  .586 _TEXT SEGMENT USE32 mov eax, [edx][ebx][ecx][edi] _TEXT ENDS END 

With MASM 6.11d, this causes the following error:

 t213a.asm(4) : error A2030: multiple index registers not allowed 

There is no error in MASM 8.00.50727.42 or later, and the instructions are compiled for:

 00000000: 8B 04 0F mov eax,dword ptr [edi+ecx] 

So, [edx][ebx][ecx][edi] not a valid addressing mode. The error in the version of MASM that you use accepts it when it should reject it as an error.

+7
source

All Articles