Change IS_DS390 to .model=FLAT24
[fw/sdcc] / doc / sdccman.html / node21.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
3 <!--Converted with LaTeX2HTML 99.1 release (March 30, 1999)
4 original version by:  Nikos Drakos, CBLU, University of Leeds
5 * revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
6 * with significant contributions from:
7   Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8 <HTML>
9 <HEAD>
10 <TITLE>3.2 Command Line Options</TITLE>
11 <META NAME="description" CONTENT="3.2 Command Line Options">
12 <META NAME="keywords" CONTENT="sdccman">
13 <META NAME="resource-type" CONTENT="document">
14 <META NAME="distribution" CONTENT="global">
15
16 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17 <META NAME="Generator" CONTENT="LaTeX2HTML v99.1 release">
18 <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
19
20 <LINK REL="STYLESHEET" HREF="sdccman.css">
21
22 <LINK REL="next" HREF="node22.html">
23 <LINK REL="previous" HREF="node20.html">
24 <LINK REL="up" HREF="node19.html">
25 <LINK REL="next" HREF="node22.html">
26 </HEAD>
27
28 <BODY >
29 <!--Navigation Panel-->
30 <A NAME="tex2html557"
31  HREF="node22.html">
32 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A> 
33 <A NAME="tex2html551"
34  HREF="node19.html">
35 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A> 
36 <A NAME="tex2html545"
37  HREF="node20.html">
38 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A> 
39 <A NAME="tex2html553"
40  HREF="node1.html">
41 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A> 
42 <A NAME="tex2html555"
43  HREF="node61.html">
44 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A> 
45 <BR>
46 <B> Next:</B> <A NAME="tex2html558"
47  HREF="node22.html">3.3 MCS51/DS390 Storage Class</A>
48 <B> Up:</B> <A NAME="tex2html552"
49  HREF="node19.html">3. Using SDCC</A>
50 <B> Previous:</B> <A NAME="tex2html546"
51  HREF="node20.html">3.1 Compiling</A>
52  &nbsp <B>  <A NAME="tex2html554"
53  HREF="node1.html">Contents</A></B> 
54  &nbsp <B>  <A NAME="tex2html556"
55  HREF="node61.html">Index</A></B> 
56 <BR>
57 <BR>
58 <!--End of Navigation Panel-->
59 <!--Table of Child-Links-->
60 <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
61
62 <UL>
63 <LI><A NAME="tex2html559"
64  HREF="node21.html#SECTION00042100000000000000">3.2.1 Processor Selection Options</A>
65 <LI><A NAME="tex2html560"
66  HREF="node21.html#SECTION00042200000000000000">3.2.2 Preprocessor Options</A>
67 <LI><A NAME="tex2html561"
68  HREF="node21.html#SECTION00042300000000000000">3.2.3 Linker Options</A>
69 <LI><A NAME="tex2html562"
70  HREF="node21.html#SECTION00042400000000000000">3.2.4 MCS51 Options</A>
71 <LI><A NAME="tex2html563"
72  HREF="node21.html#SECTION00042500000000000000">3.2.5 DS390 Options</A>
73 <LI><A NAME="tex2html564"
74  HREF="node21.html#SECTION00042600000000000000">3.2.6 Optimization Options</A>
75 <LI><A NAME="tex2html565"
76  HREF="node21.html#SECTION00042700000000000000">3.2.7 Other Options</A>
77 <LI><A NAME="tex2html566"
78  HREF="node21.html#SECTION00042800000000000000">3.2.8 Intermediate Dump Options</A>
79 </UL>
80 <!--End of Table of Child-Links-->
81 <HR>
82
83 <H2><A NAME="SECTION00042000000000000000">
84 3.2 Command Line Options</A>
85 </H2>
86
87 <P>
88
89 <H3><A NAME="SECTION00042100000000000000">
90 3.2.1 Processor Selection Options</A>
91 </H3>
92
93 <P>
94
95 <UL>
96 <LI>[<B>-mmcs51</B>]Generate code for the MCS51 (8051) family of processors.
97 This is the default processor target.</LI>
98 <LI>[<B>-mds390</B>]Generate code for the DS80C390 processor.</LI>
99 <LI>[<B>-mz80</B>]Generate code for the Z80 family of processors.</LI>
100 <LI>[<B>-mgbz80</B>]Generate code for the GameBoy Z80 processor.</LI>
101 <LI>[<B>-mavr</B>]Generate code for the Atmel AVR processor(In development,
102 not complete).</LI>
103 <LI>[<B>-mpic14</B>]Generate code for the PIC 14-bit processors(In development,
104 not complete).</LI>
105 <LI>[<B>-mtlcs900h</B>]Generate code for the Toshiba TLCS-900H processor(In
106 development, not complete).</LI>
107 </UL>
108 <P>
109
110 <H3><A NAME="SECTION00042200000000000000">
111 3.2.2 Preprocessor Options</A>
112 </H3>
113
114 <P>
115
116 <UL>
117 <LI>[<B>-I&lt;path&gt;</B>]The additional location where the pre processor
118 will look for &lt;..h&gt; or ``..h'' files.</LI>
119 <LI>[<B>-D&lt;macro[=value]&gt;</B>]Command line definition of macros.
120 Passed to the pre processor.</LI>
121 <LI>[<B>-M</B>]Tell the preprocessor to output a rule suitable for make
122 describing the dependencies of each object file. For each source file,
123 the preprocessor outputs one make-rule whose target is the object
124 file name for that source file and whose dependencies are all the
125 files `#include'd in it. This rule may be a single line or may be
126 continued with `&#92;'-newline if it is long. The list
127 of rules is printed on standard output instead of the preprocessed
128 C program. `-M' implies `-E'.</LI>
129 <LI>[<B>-C</B>]Tell the preprocessor not to discard comments. Used with
130 the `-E' option.</LI>
131 <LI>[<B>-MM</B>]Like `-M' but the output mentions only the user header
132 files included with `#include ``file&#34;'. System header
133 files included with `#include &lt;file&gt;' are omitted.</LI>
134 <LI>[<B>-Aquestion(answer)</B>]Assert the answer answer for question,
135 in case it is tested with a preprocessor conditional such as `#if
136 #question(answer)'. `-A-' disables the standard assertions that normally
137 describe the target machine.</LI>
138 <LI>[<B>-Aquestion</B>](answer) Assert the answer answer for question,
139 in case it is tested with a preprocessor conditional such as `#if
140 #question(answer)'. `-A-' disables the standard assertions that normally
141 describe the target machine.</LI>
142 <LI>[<B>-Umacro</B>]Undefine macro macro. `-U' options are evaluated
143 after all `-D' options, but before any `-include' and `-imacros' options.</LI>
144 <LI>[<B>-dM</B>]Tell the preprocessor to output only a list of the macro
145 definitions that are in effect at the end of preprocessing. Used with
146 the `-E' option.</LI>
147 <LI>[<B>-dD</B>]Tell the preprocessor to pass all macro definitions
148 into the output, in their proper sequence in the rest of the output.</LI>
149 <LI>[<B>-dN</B>]Like `-dD' except that the macro arguments and contents
150 are omitted. Only `#define name' is included in the output.</LI>
151 </UL>
152 <P>
153
154 <H3><A NAME="SECTION00042300000000000000">
155 3.2.3 Linker Options</A>
156 </H3>
157
158 <P>
159
160 <UL>
161 <LI>[<B>-L&nbsp;-lib-path</B>]&lt;absolute path to additional libraries&gt; This
162 option is passed to the linkage editor's additional libraries search
163 path. The path name must be absolute. Additional library files may
164 be specified in the command line. See section Compiling programs for
165 more details.</LI>
166 <LI>[<B>-xram-loc</B>&lt;Value&gt;]The start location of the external ram,
167 default value is 0. The value entered can be in Hexadecimal or Decimal
168 format, e.g.: -xram-loc 0x8000 or -xram-loc 32768.</LI>
169 <LI>[<B>-code-loc</B>&lt;Value&gt;]The start location of the code segment,
170 default value 0. Note when this option is used the interrupt vector
171 table is also relocated to the given address. The value entered can
172 be in Hexadecimal or Decimal format, e.g.: -code-loc 0x8000 or -code-loc
173 32768.</LI>
174 <LI>[<B>-stack-loc</B>&lt;Value&gt;]The initial value of the stack pointer.
175 The default value of the stack pointer is 0x07 if only register bank
176 0 is used, if other register banks are used then the stack pointer
177 is initialized to the location above the highest register bank used.
178 eg. if register banks 1 &amp; 2 are used the stack pointer will default
179 to location 0x18. The value entered can be in Hexadecimal or Decimal
180 format, eg. -stack-loc 0x20 or -stack-loc 32. If all four register
181 banks are used the stack will be placed after the data segment (equivalent
182 to -stack-after-data)</LI>
183 <LI>[<B>-stack-after-data</B>]This option will cause the stack to be
184 located in the internal ram after the data segment.</LI>
185 <LI>[<B>-data-loc</B>&lt;Value&gt;]The start location of the internal ram
186 data segment, the default value is 0x30.The value entered can be in
187 Hexadecimal or Decimal format, eg. -data-loc 0x20 or -data-loc 32.</LI>
188 <LI>[<B>-idata-loc</B>&lt;Value&gt;]The start location of the indirectly
189 addressable internal ram, default value is 0x80. The value entered
190 can be in Hexadecimal or Decimal format, eg. -idata-loc 0x88 or -idata-loc
191 136.</LI>
192 <LI>[<B>-out-fmt-ihx</B>]The linker output (final object code) is in
193 Intel Hex format. (This is the default option).</LI>
194 <LI>[<B>-out-fmt-s19</B>]The linker output (final object code) is in
195 Motorola S19 format.</LI>
196 </UL>
197 <P>
198
199 <H3><A NAME="SECTION00042400000000000000">
200 3.2.4 MCS51 Options</A>
201 </H3>
202
203 <P>
204
205 <UL>
206 <LI>[<B>-model-large</B>]Generate code for Large model programs see
207 section Memory Models for more details. If this option is used all
208 source files in the project should be compiled with this option. In
209 addition the standard library routines are compiled with small model,
210 they will need to be recompiled.</LI>
211 <LI>[<B>-model-small</B>]Generate code for Small Model programs see
212 section Memory Models for more details. This is the default model.</LI>
213 </UL>
214 <P>
215
216 <H3><A NAME="SECTION00042500000000000000">
217 3.2.5 DS390 Options</A>
218 </H3>
219
220 <P>
221
222 <UL>
223 <LI>[<B>-model-flat24</B>]Generate 24-bit flat mode code. This is the
224 one and only that the ds390 code generator supports right now and
225 is default when using <I>-mds390</I>. See section Memory Models for
226 more details.</LI>
227 <LI>[<B>-stack-10bit</B>]Generate code for the 10 bit stack mode of
228 the Dallas DS80C390 part. This is the one and only that the ds390
229 code generator supports right now and is default when using <I>-mds390</I>.
230 In this mode, the stack is located in the lower 1K of the internal
231 RAM, which is mapped to 0x400000. Note that the support is incomplete,
232 since it still uses a single byte as the stack pointer. This means
233 that only the lower 256 bytes of the potential 1K stack space will
234 actually be used. However, this does allow you to reclaim the precious
235 256 bytes of low RAM for use for the DATA and IDATA segments. The
236 compiler will not generate any code to put the processor into 10 bit
237 stack mode. It is important to ensure that the processor is in this
238 mode before calling any re-entrant functions compiled with this option.
239 In principle, this should work with the <I>-stack-auto</I> option,
240 but that has not been tested. It is incompatible with the <I>-xstack</I>
241 option. It also only makes sense if the processor is in 24 bit contiguous
242 addressing mode (see the <I>-model-flat24 option</I>).</LI>
243 </UL>
244 <P>
245
246 <H3><A NAME="SECTION00042600000000000000">
247 3.2.6 Optimization Options</A>
248 </H3>
249
250 <P>
251
252 <UL>
253 <LI>[<B>-nogcse</B>]Will not do global subexpression elimination, this
254 option may be used when the compiler creates undesirably large stack/data
255 spaces to store compiler temporaries. A warning message will be generated
256 when this happens and the compiler will indicate the number of extra
257 bytes it allocated. It recommended that this option NOT be used, #pragma&nbsp;NOGCSE
258 can be used to turn off global subexpression elimination for a given
259 function only.</LI>
260 <LI>[<B>-noinvariant</B>]Will not do loop invariant optimizations,
261 this may be turned off for reasons explained for the previous option.
262 For more details of loop optimizations performed see section Loop
263 Invariants.It recommended that this option NOT be used, #pragma&nbsp;NOINVARIANT
264 can be used to turn off invariant optimizations for a given function
265 only.</LI>
266 <LI>[<B>-noinduction</B>]Will not do loop induction optimizations,
267 see section strength reduction for more details.It is recommended
268 that this option is NOT used, #pragma&nbsp;NOINDUCTION can be used to
269 turn off induction optimizations for a given function only.</LI>
270 <LI>[<B>-nojtbound</B>] Will not generate boundary condition check
271 when switch statements are implemented using jump-tables. See section
272 Switch Statements for more details. It is recommended that this option
273 is NOT used, #pragma&nbsp;NOJTBOUND can be used to turn off boundary
274 checking for jump tables for a given function only.</LI>
275 <LI>[<B>-noloopreverse</B>]Will not do loop reversal optimization.</LI>
276 </UL>
277 <P>
278
279 <H3><A NAME="SECTION00042700000000000000">
280 3.2.7 Other Options</A>
281 </H3>
282
283 <P>
284
285 <UL>
286 <LI>[<B>-c&nbsp;-compile-only</B>]will compile and assemble the source,
287 but will not call the linkage editor.</LI>
288 <LI>[<B>-E</B>]Run only the C preprocessor. Preprocess all the C source
289 files specified and output the results to standard output.</LI>
290 <LI>[<B>-stack-auto</B>]All functions in the source file will be compiled
291 as <I>reentrant</I>, i.e. the parameters and local variables will
292 be allocated on the stack. see section Parameters and Local Variables
293 for more details. If this option is used all source files in the project
294 should be compiled with this option. </LI>
295 <LI>[<B>-xstack</B>]Uses a pseudo stack in the first 256 bytes in the
296 external ram for allocating variables and passing parameters. See
297 section on external stack for more details.</LI>
298 <LI>[<B>-callee-saves</B>]<B>function1[,function2][,function3]....</B>
299 The compiler by default uses a caller saves convention for register
300 saving across function calls, however this can cause unneccessary
301 register pushing &amp; popping when calling small functions from larger
302 functions. This option can be used to switch the register saving convention
303 for the function names specified. The compiler will not save registers
304 when calling these functions, no extra code will be generated at the
305 entry &amp; exit for these functions to save &amp; restore the registers
306 used by these functions, this can SUBSTANTIALLY reduce code &amp; improve
307 run time performance of the generated code. In the future the compiler
308 (with interprocedural analysis) will be able to determine the appropriate
309 scheme to use for each function call. DO NOT use this option for built-in
310 functions such as _muluint..., if this option is used for a library
311 function the appropriate library function needs to be recompiled with
312 the same option. If the project consists of multiple source files
313 then all the source file should be compiled with the same -callee-saves
314 option string. Also see #pragma&nbsp;CALLEE-SAVES.</LI>
315 <LI>[<B>-debug</B>]When this option is used the compiler will generate
316 debug information, that can be used with the SDCDB. The debug information
317 is collected in a file with .cdb extension. For more information see
318 documentation for SDCDB.</LI>
319 <LI>[<B><I>-regextend</I></B>] <I>This option is obsolete and isn't
320 supported anymore.</I></LI>
321 <LI>[<B><I>-noregparms</I></B>]<I>This option is obsolete and isn't
322 supported anymore.</I></LI>
323 <LI>[<B>-peep-file</B>&lt;filename&gt;]This option can be used to use additional
324 rules to be used by the peep hole optimizer. See section Peep Hole
325 optimizations for details on how to write these rules.</LI>
326 <LI>[<B>-S</B>]Stop after the stage of compilation proper; do not assemble.
327 The output is an assembler code file for the input file specified.</LI>
328 <LI>[<B>-Wa_asmOption[,asmOption]</B>...]Pass the asmOption to
329 the assembler.</LI>
330 <LI>[<B>-Wl_linkOption[,linkOption]</B>...]Pass the linkOption
331 to the linker.</LI>
332 <LI>[<B>-int-long-reent</B>] Integer (16 bit) and long (32 bit) libraries
333 have been compiled as reentrant. Note by default these libraries are
334 compiled as non-reentrant. See section Installation for more details.</LI>
335 <LI>[<B>-cyclomatic</B>]This option will cause the compiler to generate
336 an information message for each function in the source file. The message
337 contains some <I>important</I> information about the function. The
338 number of edges and nodes the compiler detected in the control flow
339 graph of the function, and most importantly the <I>cyclomatic complexity</I>
340 see section on Cyclomatic Complexity for more details.</LI>
341 <LI>[<B>-float-reent</B>] Floating point library is compiled as reentrant.See
342 section Installation for more details.</LI>
343 <LI>[<B>-nooverlay</B>] The compiler will not overlay parameters and
344 local variables of any function, see section Parameters and local
345 variables for more details.</LI>
346 <LI>[<B>-main-return</B>]This option can be used when the code generated
347 is called by a monitor program. The compiler will generate a 'ret'
348 upon return from the 'main' function. The default option is to lock
349 up i.e. generate a 'ljmp '.</LI>
350 <LI>[<B>-no-peep</B>] Disable peep-hole optimization.</LI>
351 <LI>[<B>-peep-asm</B>] Pass the inline assembler code through the peep
352 hole optimizer. This can cause unexpected changes to inline assembler
353 code, please go through the peephole optimizer rules defined in the
354 source file tree '&lt;target&gt;/peeph.def' before using this option.</LI>
355 <LI>[<B>-iram-size</B>&lt;Value&gt;]Causes the linker to check if the interal
356 ram usage is within limits of the given value.</LI>
357 <LI>[<B>-nostdincl</B>]This will prevent the compiler from passing
358 on the default include path to the preprocessor.</LI>
359 <LI>[<B>-nostdlib</B>]This will prevent the compiler from passing on
360 the default library path to the linker.</LI>
361 <LI>[<B>-verbose</B>]Shows the various actions the compiler is performing.</LI>
362 <LI>[<B>-V</B>]Shows the actual commands the compiler is executing.</LI>
363 </UL>
364 <P>
365
366 <H3><A NAME="SECTION00042800000000000000">
367 3.2.8 Intermediate Dump Options</A>
368 </H3>
369
370 <P>
371 The following options are provided for the purpose of retargetting
372 and debugging the compiler. These provided a means to dump the intermediate
373 code (iCode) generated by the compiler in human readable form at various
374 stages of the compilation process. 
375
376 <P>
377
378 <UL>
379 <LI>[<B>-dumpraw</B>]This option will cause the compiler to dump the
380 intermediate code into a file of named <I>&lt;source filename&gt;.dumpraw</I>
381 just after the intermediate code has been generated for a function,
382 i.e. before any optimizations are done. The basic blocks at this stage
383 ordered in the depth first number, so they may not be in sequence
384 of execution.</LI>
385 <LI>[<B>-dumpgcse</B>]Will create a dump of iCode's, after global subexpression
386 elimination, into a file named <I>&lt;source filename&gt;.dumpgcse.</I></LI>
387 <LI>[<B>-dumpdeadcode</B>]Will create a dump of iCode's, after deadcode
388 elimination, into a file named <I>&lt;source filename&gt;.dumpdeadcode.</I></LI>
389 <LI>[<B>-dumploop</B>]Will create a dump of iCode's, after loop optimizations,
390 into a file named <I>&lt;source filename&gt;.dumploop.</I></LI>
391 <LI>[<B>-dumprange</B>]Will create a dump of iCode's, after live range
392 analysis, into a file named <I>&lt;source filename&gt;.dumprange.</I></LI>
393 <LI>[<B>-dumlrange</B>]Will dump the life ranges for all symbols.</LI>
394 <LI>[<B>-dumpregassign</B>]Will create a dump of iCode's, after register
395 assignment, into a file named <I>&lt;source filename&gt;.dumprassgn.</I></LI>
396 <LI>[<B>-dumplrange</B>]Will create a dump of the live ranges of iTemp's</LI>
397 <LI>[<B>-dumpall</B>]Will cause all the above mentioned dumps to be
398 created.</LI>
399 </UL>
400 <P>
401 <HR>
402 <!--Navigation Panel-->
403 <A NAME="tex2html557"
404  HREF="node22.html">
405 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A> 
406 <A NAME="tex2html551"
407  HREF="node19.html">
408 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A> 
409 <A NAME="tex2html545"
410  HREF="node20.html">
411 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A> 
412 <A NAME="tex2html553"
413  HREF="node1.html">
414 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A> 
415 <A NAME="tex2html555"
416  HREF="node61.html">
417 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A> 
418 <BR>
419 <B> Next:</B> <A NAME="tex2html558"
420  HREF="node22.html">3.3 MCS51/DS390 Storage Class</A>
421 <B> Up:</B> <A NAME="tex2html552"
422  HREF="node19.html">3. Using SDCC</A>
423 <B> Previous:</B> <A NAME="tex2html546"
424  HREF="node20.html">3.1 Compiling</A>
425  &nbsp <B>  <A NAME="tex2html554"
426  HREF="node1.html">Contents</A></B> 
427  &nbsp <B>  <A NAME="tex2html556"
428  HREF="node61.html">Index</A></B> 
429 <!--End of Navigation Panel-->
430 <ADDRESS>
431 <I>Johan Knol</I>
432 <BR><I>2001-07-13</I>
433 </ADDRESS>
434 </BODY>
435 </HTML>