2.2 Startup Code
In order to initialize variables in data memory, the linker creates a data initialization template. This template must be processed at startup, before the application proper takes control. For C programs, this function is performed by the startup modules in libc99-pic30-elf.a; the source code for these modules is included with libpic30.zip found in the src directory of the installation. Assembly language programs can utilize these modules directly by linking with the desired startup module file. The source code for the startup modules is provided in corresponding .s files.
The primary startup module (crt0) initializes all variables (variables without initializers are set to zero as required by the ANSI standard) except for variables in the persistent data section. The alternate startup module (crt1) performs no data initialization.
For more information on start-up code, see the MPLAB® XC-DSC Assembler, Linker and Utilities User’s Guide (DS-50003590) and for C applications, the MPLAB® XC-DSC C Compiler User’s Guide (DS-50003589).