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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DSPICC Command-line DriverDSPICC Compiler Optionsthat they are in addition to the other suboptions present, or a minus character “-”, to indicate thatthey should be excluded. In the following sections, angle brackets, < >, are used to indicate optionalparts of the command.2.4.1 -Bmodel: Select memory modelThe compiler implements two memory models: small and large. These are selected by either usingthe -Bs or -Bl options for small or large memory model respectively. In most cases small modelwill suffice, and is the compiler’s default setting. If the selected processor has accessible programmemory at addresses above 0xFFFF and the program makes use of function pointers which maypoint to functions located above this address, then selecting large model will cause the compilerto generate code so that function pointers can reach these distant addresses. This is accomplishedautomatically through the use of a jump table so that the need for larger pointer sizes is not required.2.4.2 -C: Compile to Object FileThe -C option is used to halt compilation after generating a relocatable object file. This option isfrequently used when compiling multiple source files using a “make” utility. If multiple source filesare specified to the compiler each will be compiled to a separate .obj file. The object files will beplaced in the directory in which DSPICC was invoked, to handle situations where source files arelocated in read-only directories. To compile three source files main.c, module1.c and asmcode.asto object files you could use a command similar to:DSPICC --CHIP=30F6014 -C main.c module1.c asmcode.asThe compiler will produce three object files main.obj, module1.obj and asmcode.obj whichcould then be linked to produce an Intel HEX file using the command:DSPICC --CHIP=30F6014 main.obj module1.obj asmcode.obj2.4.3 -Dmacro: Define MacroThe -D option is used to define a preprocessor macro on the command line, exactly as if it hadbeen defined using a #define directive in the source code. This option may take one of two forms,-Dmacro which is equivalent to:#define macro 1placed at the top of each module compiled using this option, or -Dmacro=text which is equivalentto:7

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

Saved successfully!

Ooh no, something went wrong!