FIX: MASM Generates Incorrect Code for Indirect Addressing (99239)
The information in this article applies to:
- Microsoft Macro Assembler (MASM) 6.0
- Microsoft Macro Assembler (MASM) 6.0a
- Microsoft Macro Assembler (MASM) 6.0b
- Microsoft Macro Assembler (MASM) 6.1
- Microsoft Macro Assembler (MASM) 6.1a
This article was previously published under Q99239 SYMPTOMS
Microsoft Macro Assembler (MASM) generates incorrect code when an
indirect addressing using 32-bit registers uses a label located in
a 16-bit segment as the first argument in the list that forms the
indirect address.
CAUSE
When the first operand in the list of operands that forms the indirect
address is a label located in a 16-bit segment, MASM interprets the
indirect address as a 16-bit reference to the segment.
RESOLUTION
To work around this problem, perform one of the following two steps:
- Use a 32-bit register as the first operand in the indirect
address.
- Place the label outside the brackets.
The code example below demonstrates both of these techniques.
STATUS
Microsoft has confirmed this to be a problem in MASM versions 6.0,
6.0a, 6.0b, 6.1, and 6.1a. This problem was corrected in MASM for
MS-DOS version 6.11.
Modification Type: | Major | Last Reviewed: | 10/22/2003 |
---|
Keywords: | kbfix KB99239 |
---|
|