MSM9111001: Alignment in Nested Structures Incorrect in MASM 6

ID Number: Q77945

6.00 | 6.00

MS-DOS | OS/2

buglist6.00 fixlist6.00a

Summary:

PROBLEM ID: MSM9111001

SYMPTOMS

The Microsoft Macro Assembler (MASM) version 6.0 does not pad

aligned nested structures correctly. The list file shown below

illustrates this problem.

RESOLUTION

Manually padding the structure definition to force the nested

structure to have the correct alignment will work around this

problem.

STATUS

Microsoft has confirmed this to be a problem in MASM version 6.0.

This problem was corrected in MASM version 6.0a.

More Information:

Sample Code

-----------

; Assemble options needed: /c

.MODEL SMALL,C

0000 .DATA

0003 struct1 STRUCT 2 ; Alignment value is 2

0000 0000 field1 WORD ? ; Offset is 0

0002 00 field2 BYTE ? ; Offset is 2

struct1 ENDS

0004 struct2 STRUCT 2 ; Alignment value is 2

0000 00 field3 BYTE ? ; Offset is 0

0001 0000 00 nested struct1 <?, ?> ; Offset is 1, should

struct2 ENDS ; be padded to 2

END

Additional reference words: 6.00