A source library is an assembly language source file, with special comments interpreted by cpik linker. Each special comment begins with ";<", located at first column, and ends with ">". Any information inserted after the final ">" are really comments and will be ignored by the linker.
Source libraries are structured in modules, each module can contains either data or code.
Here is the list of recognized special comments:
;<+module_name>
The module name can be optionally followed by the specification of a program section, with the following syntax:
;<+module_name|section_type>
The cpik linker supports 4 types of program sections :
This segment is dedicated to const data. Such data will be located at begin of ROM and will not copied to RAM
This segment is dedicated to initialized data. The module must contain the «;<=» tag (see below) with exact number of bytes to be used for initialization
This segment is dedicated to uninitialized data and is filled with nul bytes during boot.
This segment contains all other kind of modules (code, symbols, etc.)
A module with no section specification will be included in the CODE program section.
;<->
;<?module_name>
;<= byte1 byte2 ... >
Example:
int table[3] = { 1, 2 } ; unsigned char x2(unsigned char c) { return c * 2 ; }will generate:
;<+C18_table|IDATA> CBLOCK C18_table:3 ENDC ;<= 1 2 0 > ;<-> ;<+C18_x2> unsigned char x2(unsigned char c@0) C18_x2 ; return c * 2 ; movff INDF0,PREINC0 movlw 2 ICALL mul8u movff POSTDEC0,R0 ; } L18_main_x2_0 return 0 ;<?mul8u> ;<->
AG 2013-04-10