Results of not Specifying a Starting Address

Last reviewed: January 23, 1995
Article ID: Q24955
The information in this article applies to:
  • Microsoft Macro Assembler for MS-DOS, versions 3.0x, 4.x, 5.0, 5.1, 6.0, 6.0a, and 6.0b

SUMMARY

If a starting address is not explicitly specified, then the starting address will be one of the following:

1) The beginning of the code if the simplified segment directives

   .model and .code are used (MASM 5.0 and later).

   -or-

2) The first segment loaded into memory if full segment directives
   are used. This will result in the execution of the data segment
   if it is the first segment loaded and the results will be
   unpredictable.

Versions of the linker prior to version 5.05 do not warn if a starting address is not specified. Link version 5.13 (shipped with MASM 6.0) issues the following warning:

   L4038: program has no starting address

MORE INFORMATION

The END directive is used to mark the end of the source file and can optionally be used to set the starting address which will be loaded into CS:IP when the program executes. For example

   END start

would specify that execution should begin at the label named start.


Additional reference words: kbinf 3.x 4.x 5.00 5.10 6.00 6.00a 6.00b
KBCategory: kbprg
KBSubCategory: MASMLngIss


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.