ENTRY directive declares an entry point to a program.
A program must have an entry point. You can specify an entrypoint in the following ways:
ENTRYdirectivein assembly language source code.
main()functionin C or C++ source code.
armlink --entrycommand-line option.
You can declare more than one entry point in a program, althougha source file cannot contain more than one
ENTRY directive.For example, a program could contain multiple assembly languagesource files, each with an
ENTRY directive.Or it could contain a C or C++ file with a
main() functionand one or more assembly source files with an
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.
AREA ARMex, CODE, READONLY ENTRY ; Entry point for the application. EXPORT ep1 ; Export the symbol so the linker can find itep1 ; in the object file. ; code END
When you invoke armlink, if other entry points are declared in the program, then you must specify
--entry=ep1, to select