## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### END (Define End of Module and Entry Point)

The END directive has two functions:

Identifies the end of the source program.
Identifies the symbol that is the name of the entry point (through the Expression on the END directive)

Syntax

    END   [ Expression ]

Remarks

All source files must have the END directive as the last statement. Any lines following the END statement are ignored by the assembler.

When the linker builds an application program from one or more object modules, it needs to know where the entry point is for the operating system to pass initial control. If you do not specify an entry point, none is assumed. Only one module can identify a label as the entry point by specifying that label on its END statement. Any module not defining an operating system entry point must not have an entry point identified on its END statement. If you fail to define an entry point for the main module, your program may not be able to initialize correctly. It will assemble and link without error, but it cannot run.

Example

The following example is the END statement for the section of code that starts with the name BEGIN.

    END   BEGIN