MPLAB_ASM30_Suite\lib\README


=== Overview ===
Optional Libraries for Assembly Language Programs

  libpic30-coff.a
  libpic30-elf.a

These libraries are provided so that assembly language
applications can use C runtime startup modules to
initialize sections in data memory.


=== Example of Use ===
To define a section that will be initialized at startup:

      .section *,data
      .global foo
foo:  .word 0x1234

To incorporate the C startup modules:

1. Add the appropriate library to your project.

2. If building from the command line, add -lpic30
   to the link options.

3. Use global label _main (instead of __reset) as the entry
   point for your application.


=== Discussion ===
Note that multiple versions of the startup modules are
contained within the libraries. The linker will select
a startup module based on commands in the linker script.

For example, the following statements appear in
linker scripts for many devices:

CRT0_STARTUP(crt0_standard.o)
CRT1_STARTUP(crt1_standard.o)

Some device families require different startup modules;
they will be specified in the linker script.


=== References ===
The source code for these libraries is included with
the MPLAB C30 compiler. Academic and evaluation editions
are available for download at www.microchip.com/c30.

For more information about initialized data and runtime
library support, refer to chapter 10.8, "Initialized Data",
in the Assembler, Linker manual (DS51317).

