Line Numbers in .MAP File Do Not Relate to Listing File

Last reviewed: January 23, 1995
Article ID: Q76163
The information in this article applies to:
  • Microsoft Macro Assembler for MS-DOS, versions 5.0, 5.1, and 5.1a
  • Microsoft Macro Assembler for OS/2, versions 5.1 and 5.1a

SUMMARY

When using the Microsoft Macro Assembler (MASM) version 5.0, 5.1, or 5.1a and generating a cross-reference file, the listing file generated will contain line numbers. These line numbers do not relate to the line numbers listed in the .MAP file when specifying the /LINE linker option.

The line number information generated in the .MAP file with the /LINE option relates to the source file and not to the listing file. Therefore, relying on the .MAP file to give information relating to assembler-generated listing file is not valid because listing files contain added information.

MORE INFORMATION

The sample code below contains two NOP statements to show executable code lines. The .MAP file contains line number information corresponding to the source file's executable lines. This is the intended use of the line number information generated by the .MAP file. It is not intended for these line numbers to relate to the lines of the listing file.

TEST.ASM:

; Assemble options needed: /Zd /c /l ; Link options needed: /L

.MODEL SMALL .STACK 100H .CODE start:

   nop
   nop
END start

TEST.MAP:

 Start  Stop   Length Name                   Class
 00000H 00001H 00002H _TEXT                  CODE
 00002H 00002H 00000H _DATA                  DATA
 00010H 0010FH 00100H STACK                  STACK

 Origin   Group
 0000:0   DGROUP

  Address         Publics by Name


  Address         Publics by Value


  Line numbers for TEST.OBJ(test.asm) segment _TEXT

     5 0000:0000     6 0000:0001

  Program entry point at 0000:0000


Additional reference words: kbinf 5.00 5.10 5.10a
KBCategory: kbtool
KBSubCategory: MLIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 23, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.