The _c_int00 Function

The function _c_int00 is the startup routine (also called the boot routine) for C/C++ programs. It performs all the steps necessary for a C/C++ program to initialize itself.

The name _c_int00 means that it is the interrupt handler for interrupt number 0, RESET, and that it sets up the C environment. Its name need not be exactly _c_int00, but the linker sets _c_int00 as the entry point for C programs by default. The compiler's run-time-support library provides a default implementation of _c_int00.

The startup routine is responsible for performing the following actions:

  1. Set up the stack by initializing SP
  2. Set up the data page pointer DP (for architectures that have one)
  3. Set configuration registers
  4. Process the .cinit table to autoinitialize global variables (when using the --rom_model option)
  5. Process the .pinit table to construct global C++ objects.
  6. Call the function main with appropriate arguments
  7. Call exit when main returns