The information in this article applies to:
SYMPTOMSWhen using scaled indexed addressing in the following Microsoft Macro Assembler (MASM) 5.0, 5.1, or 5.1a instruction, the opcode generated is incorrect. Note that the variable "esi" is being used as an index into a structure and "eax" is the base.
The opcodes generated by MASM indicate that MASM is not using scaled
indexed addressing. The code generated by MASM is effectively the same as:
CAUSEThe problem occurs because the "." operator has a higher precedence than the "*" operator. MASM turns:
as a result of the precedence. MASM evaluates "(eax+esi)" as a constant
instead of a register. Thus, the result of the constant expression
"(eax+esi)" is multiplied by two and the addressing mode is lost. This
results in MASM interpretting the operand as [eax+esi]
RESOLUTIONOne workaround is to use the "+" operator which has lower precedence than the "." operator and produces the correct result. Alternately parenthesis can be used to give higher precedence to the "*" operator. STATUSMicrosoft has confirmed this to be a problem in MASM version 5.0, 5.1, and 5.1a. This problem was corrected in MASM version 6.0. MORE INFORMATIONUnder Microsoft MASM 6.0 the following error will be generated.
Sample Code
Additional query words: 5.00 5.10 5.10a buglist5.00 buglist5.10 buglist5.10a fixlist6.00
Keywords : |
Last Reviewed: January 4, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |