Everything
8.3 Startup Program Creation

Here, processing to prepare the environment for program execution is described. However, the environment for program execution will differ among user systems, and so a program to set the execution environment must be created according to the specifications of the user system.

This section describes the standard startup program. The startup program for an application that uses the PIC/PID function needs special processing; refer also to section 8.5.7 Application Startup.

A summary of the necessary procedures is given below.

-

Fixed vector table setting

Sets the fixed vector table to initiate the initial setting routine (PowerOn_Reset_PC) at a power-on reset. In addition to the reset vector, processing routines, such as, privileged instruction exception, access exception, undefined instruction exception, floating-point exception, and nonmaskable interrupt, can be registered to the fixed vector table.

-

Initial setting

Performs the procedures required to reach the main function. Registers and sections are initialized and various initial setting routines are called.

-

Low-level interface routine creation

Routines providing an interface between the user system and library functions which are necessary when standard I/O (stdio.h, ios, streambuf, istream, and ostream) and memory management libraries (stdlib.h and new) are used.

-

Termination processing routine (exit, atexit, and abort)* creation

Processing for terminating the program is performed.

Note

* When using the C library function exit, atexit, or abort to terminate a program, these functions must be created as appropriate to the user system.
When using the C++ program or C library macro assert, the abort function must always be created.