Keil Logo Arm Logo

ENTRY

ENTRY

The ENTRY directive declares an entry point to a program.

Show/hideSyntax

ENTRY

Show/hideUsage

A program must have an entry point. You can specify an entry point in the following ways:

  • Using the ENTRY directive in assembly language source code.

  • Providing a main() function in C or C++ source code.

  • Using the armlink --entry command line option.

You can declare more than one entry point in a program, although a source file cannot contain more than one ENTRY directive. For example, a program could contain multiple assembly language source files, each with an ENTRY directive. Or it could contain a C or C++ file with a main() function and one or more assembly source files with an ENTRY directive.

If the program contains multiple entry points, then you must select one of them. You do this by exporting the symbol for the ENTRY directive that you want to use as the entry point, then using the armlink --entry option to select the exported symbol.

Show/hideExample

        AREA   ARMex, CODE, READONLY
        ENTRY      ; Entry point for the application
        EXPORT ep1 ; Export the symbol so the linker can find it in the object file
ep1
        ; code

        END

When you invoke armlink, if other entry points are declared in the program, then you must specify --entry=ep1, to select ep1.

Show/hideSee also

Concepts
Reference
Copyright © 2011-2012 ARM. All rights reserved.ARM DUI 0588B
Non-ConfidentialID062912

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.