Compiler Error C2422

illegal segment override in 'operand'

Within inline assembler code, a segment override operator (':') was used improperly on an operand.

The register preceding the segment override operator must be a segment register, and the only segment register in the operand. The segment override operator cannot appear within the brackets of the indirection operator ('[' and ']') and the expression following the segment override operator must be either an immediate operand or a memory operand; it cannot be a register operand.

The following is an example of this error:

_asm
{
  mov    AX, [BX:ES]        //Error
  mov    AX, ES:[BX]        //OK
}