FIX: MASM 6.0 Generates L1103 for Nested StructuresLast reviewed: September 16, 1997Article ID: Q79146 |
6.00 | 6.00
MS-DOS | OS/2
kbtool kbfixlist kbbuglist
The information in this article applies to:
SYMPTOMSThe Microsoft Macro Assembler (MASM) version 6.0 may produce an invalid object file, generating the following error message at link time:
fatal error L1103: attempt to access data outside segment boundsThe error occurs when a number of nested UNIONS and STRUCTURES are used.
RESOLUTIONA work around is to rearrange the order of the outer-most structure. The sample code below illustrates this.
STATUSMicrosoft has confirmed this to be a problem in MASM version 6.0. This problem was corrected in MASM version 6.0a.
MORE INFORMATIONThe sample code below illustrates this problem. If the MASM switch /Fl is used to generate a listing file, it can be seen that the assembler generates an offset for "BAD" of 001E in the structure ST1. Because this structure is a copy of the previous structure (ST0), the offset for BAD in each structure should be the same, the correct offset is 0014. No assembler error or warning is generated, but when the .OBJ file is linked, the L1103 error is generated. Note: In the file listing, an incorrect offset is generated, but in the symbol listing, a correct offset is displayed for both instances of BAD.
Sample Code; Rearranging ST1 as indicated in the comments fixed the problem in ST1 ; for this sample code. ; Assemble options needed: none ; (use /Fl to generate listing file) .MODEL small .STACK 4096 ST0 STRUCT UNION STRUCT A BYTE 10 DUP ('A') UNION B BYTE 10 DUP ('B') D BYTE 10 DUP ('D') ENDS ENDS E BYTE 10 DUP ('E') ENDS BAD BYTE (' ')ST0 ENDS
ST1 STRUCT ; ST1 STRUCT UNION ; BAD BYTE (' ') E BYTE 10 DUP ('E') ; UNION STRUCT ; E BYTE 10 DUP ('E') A BYTE 10 DUP ('A') ; STRUCT UNION ; A BYTE 10 DUP ('A') B BYTE 10 DUP ('B') ; UNION D BYTE 10 DUP ('D') ; B BYTE 10 DUP ('B') ENDS ; D BYTE 10 DUP ('D') ENDS ; ENDS ENDS ; ENDS BAD BYTE (' ') ; ENDS ST1 ENDS ; ST1 ENDS.DATA
item1 ST0 <> item2 ST1 <>.CODE .startup .exit 0END
|
Additional reference words: 6.00 buglist6.00 fixlist6.00a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |