11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FilesC Language FeaturesThis option will also generate other symbol files for each module compiled. These files are producedby the code generator and do not contain absolute address. These files have the extension .sdb.The base name will be the same as the base name of the module being compiled. Thus the abovecommand line would also generate symbols files with the names test.sdb and init.sdb.3.3.3 Standard LibrariesHI-TECH C includes a number of standard libraries, each with the range of functions described inAppendix A. Library files have the extensions .lib. Some compiler options affect the name andnumber of library files which are required, however the appropriate libraries are automatically linkedwhen using the command-line driver, DSPICC.3.3.4 Runtime startup ModulesA C program requires certain objects to be initialised and the processor to be in a particular statebefore it can begin execution of its function main(). It is the job of the runtime startup code toperform these tasks.Traditionally, runtime startup code is a generic, precompiled routine which is always linked intoa user’s program. Even if a user’s program does not need all aspects of the runtime startup code,redundant code is linked in which, albeit not harmful, takes up memory and slows execution. Forexample, if a program does not use any uninitialized variables, then no routine is required to clearthe bss psects.HI-TECH <strong>dsPIC</strong>C differs from other compilers by using a novel method to determine exactlywhat runtime startup code is required and links this into the program automatically. It does this byperforming an additional link step which does not produce any usable output, but which can be usedto determine the requirements of the program. From this information DSPICC then “writes” theassembler code which will perform the runtime startup. This code is stored into a file which canthen be assembled and linked into the remainder of the program in the usual way.Since the runtime startup code is generated automatically on every compilation, the generatedfiles associated with this process are deleted after they have been used. If required, the assemblerfile which contains the runtime startup code can be kept after compilation and linking by using thedriver option --RUNTIME=default,+keep. The residual file will be called startup.as and will belocated in the current working directory. If you are using an IDE to perform the compilation thedestination directory is dictated by the IDE itself, however you may use the --OUTDIR option tospecify an explicit output directory to the compiler.This is an automatic process which does not require any user interaction, however some aspectsof the runtime code can be controlled, if required, using the --RUNTIME option. These are describedin the sections below.26

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!