6

In Visual Studio, I wrote:

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

But it assembles just fine.

Why it is not invalid effective address?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847

1 Answers1

7

It appears to be a bug in more recent 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 generates the following error:

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

With MASM 8.00.50727.42 or more recent there's no error, and the statement assembles to:

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

So [edx][ebx][ecx][edi] is not a valid addressing mode. A bug in the version of MASM you're using is accepting it when it should be rejecting it as an error.

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112