📄 sdccman.txt
字号:
target is the object file name for that source file andwhose dependencies are all the files `#include'd in it.This rule may be a single line or may be continued with`\'-newline if it is long. The list of rules is printed onstandard output instead of the preprocessed C program. `-M'implies `-E'.-C Tell the preprocessor not to discard comments. Used withthe `-E' option.-MM Like `-M' but the output mentions only the user headerfiles included with `#include "file"'.System header files included with `#include <file>' areomitted.-Aquestion(answer) Assert the answer answer for question,in case it is tested with a preprocessor conditional suchas `#if #question(answer)'. `-A-' disables the standardassertions that normally describe the target machine.-Aquestion (answer) Assert the answer answer for question,in case it is tested with a preprocessor conditional suchas `#if #question(answer)'. `-A-' disables the standardassertions that normally describe the target machine.-Umacro Undefine macro macro. `-U' options are evaluatedafter all `-D' options, but before any `-include' and `-imacros'options.-dM Tell the preprocessor to output only a list of the macrodefinitions that are in effect at the end of preprocessing.Used with the `-E' option.-dD Tell the preprocessor to pass all macro definitions intothe output, in their proper sequence in the rest of theoutput.-dN Like `-dD' except that the macro arguments and contentsare omitted. Only `#define name' is included in the output. Linker Options-L --lib-path <absolute path to additional libraries> Thisoption is passed to the linkage editor's additional librariessearch path. The path name must be absolute. Additionallibrary files may be specified in the command line. Seesection Compiling programs for more details.--xram-loc<Value> The start location of the external ram,default value is 0. The value entered can be in Hexadecimalor Decimal format, e.g.: --xram-loc 0x8000 or --xram-loc32768.--code-loc<Value> The start location of the code segment,default value 0. Note when this option is used the interruptvector table is also relocated to the given address. Thevalue entered can be in Hexadecimal or Decimal format, e.g.:--code-loc 0x8000 or --code-loc 32768.--stack-loc<Value> The initial value of the stack pointer.The default value of the stack pointer is 0x07 if only registerbank 0 is used, if other register banks are used then thestack pointer is initialized to the location above the highestregister bank used. eg. if register banks 1 & 2 are usedthe stack pointer will default to location 0x18. The valueentered can be in Hexadecimal or Decimal format, eg. --stack-loc0x20 or --stack-loc 32. If all four register banks are usedthe stack will be placed after the data segment (equivalentto --stack-after-data)--stack-after-data This option will cause the stack to belocated in the internal ram after the data segment.--data-loc<Value> The start location of the internal ramdata segment, the default value is 0x30.The value enteredcan be in Hexadecimal or Decimal format, eg. --data-loc0x20 or --data-loc 32.--idata-loc<Value> The start location of the indirectly addressableinternal ram, default value is 0x80. The value entered canbe in Hexadecimal or Decimal format, eg. --idata-loc 0x88or --idata-loc 136.--out-fmt-ihx The linker output (final object code) is inIntel Hex format. (This is the default option).--out-fmt-s19 The linker output (final object code) is inMotorola S19 format. MCS51 Options--model-large Generate code for Large model programs seesection Memory Models for more details. If this option isused all source files in the project should be compiledwith this option. In addition the standard library routinesare compiled with small model, they will need to be recompiled.--model-small Generate code for Small Model programs seesection Memory Models for more details. This is the defaultmodel. DS390 Options--model-flat24 Generate 24-bit flat mode code. This is theone and only that the ds390 code generator supports rightnow and is default when using -mds390. See section MemoryModels for more details.--stack-10bit Generate code for the 10 bit stack mode ofthe Dallas DS80C390 part. This is the one and only thatthe ds390 code generator supports right now and is defaultwhen using -mds390. In this mode, the stack is located inthe lower 1K of the internal RAM, which is mapped to 0x400000.Note that the support is incomplete, since it still usesa single byte as the stack pointer. This means that onlythe lower 256 bytes of the potential 1K stack space willactually be used. However, this does allow you to reclaimthe precious 256 bytes of low RAM for use for the DATA andIDATA segments. The compiler will not generate any codeto put the processor into 10 bit stack mode. It is importantto ensure that the processor is in this mode before callingany re-entrant functions compiled with this option. In principle,this should work with the --stack-auto option, but thathas not been tested. It is incompatible with the --xstackoption. It also only makes sense if the processor is in24 bit contiguous addressing mode (see the --model-flat24option). Optimization Options--nogcse Will not do global subexpression elimination, thisoption may be used when the compiler creates undesirablylarge stack/data spaces to store compiler temporaries. Awarning message will be generated when this happens andthe compiler will indicate the number of extra bytes itallocated. It recommended that this option NOT be used,#pragma NOGCSE can be used to turn off global subexpressionelimination for a given function only.--noinvariant Will not do loop invariant optimizations, thismay be turned off for reasons explained for the previousoption. For more details of loop optimizations performedsee section Loop Invariants.It recommended that this optionNOT be used, #pragma NOINVARIANT canbe used to turn off invariant optimizations for a givenfunction only.--noinduction Will not do loop induction optimizations, seesection strength reduction for more details.It is recommendedthat this option is NOT used, #pragma NOINDUCTIONcan be used to turn off induction optimizations for a givenfunction only.--nojtbound Will not generate boundary condition check whenswitch statements are implemented using jump-tables. Seesection Switch Statements for more details. It is recommendedthat this option is NOT used, #pragma NOJTBOUNDcan be used to turn off boundary checking for jump tablesfor a given function only.--noloopreverse Will not do loop reversal optimization. Other Options-c --compile-only will compile and assemble the source,but will not call the linkage editor.-E Run only the C preprocessor. Preprocess all the C sourcefiles specified and output the results to standard output.--stack-auto All functions in the source file will be compiledas reentrant, i.e. the parameters and local variables willbe allocated on the stack. see section Parameters and LocalVariables for more details. If this option is used all sourcefiles in the project should be compiled with this option. --xstack Uses a pseudo stack in the first 256 bytes in theexternal ram for allocating variables and passing parameters.See section on external stack for more details.--callee-saves function1[,function2][,function3].... Thecompiler by default uses a caller saves convention for registersaving across function calls, however this can cause unneccessaryregister pushing & popping when calling small functionsfrom larger functions. This option can be used to switchthe register saving convention for the function names specified.The compiler will not save registers when calling thesefunctions, no extra code will be generated at the entry& exit for these functions to save & restore the registersused by these functions, this can SUBSTANTIALLY reduce code& improve run time performance of the generated code. Inthe future the compiler (with interprocedural analysis)will be able to determine the appropriate scheme to usefor each function call. DO NOT use this option for built-infunctions such as _muluint..., if this option is used fora library function the appropriate library function needsto be recompiled with the same option. If the project consistsof multiple source files then all the source file shouldbe compiled with the same --callee-saves option string.Also see #pragma CALLEE-SAVES.--debug When this option is used the compiler will generatedebug information, that can be used with the SDCDB. Thedebug information is collected in a file with .cdb extension.For more information see documentation for SDCDB.--regextend This option is obsolete and isn't supportedanymore.--noregparms This option is obsolete and isn't supportedanymore.--peep-file<filename> This option can be used to use additionalrules to be used by the peep hole optimizer. See sectionPeep Hole optimizations for details on how to write theserules.-S Stop after the stage of compilation proper; do not assemble.The output is an assembler code file for the input filespecified.-Wa_asmOption[,asmOption]... Pass the asmOption to the assembler.-Wl_linkOption[,linkOption]... Pass the linkOption to thelinker.--int-long-reent Integer (16 bit) and long (32 bit) librarieshave been compiled as reentrant. Note by default these librariesare compiled as non-reentrant. See section Installationfor more details.--cyclomatic This option will cause the compiler to generatean information message for each function in the source file.The message contains some important information about thefunction. The number of edges and nodes the compiler detectedin the control flow graph of the function, and most importantlythe cyclomatic complexity see section on Cyclomatic Complexityfor more details.--float-reent Floating point library is compiled as reentrant.Seesection Installation for more details.--nooverlay The compiler will not overlay parameters andlocal variables of any function, see section Parametersand local variables for more details.--main-return This option can be used when the code generatedis called by a monitor program. The compiler will generatea 'ret' upon return from the 'main' function. The defaultoption is to lock up i.e. generate a 'ljmp '.--no-peep Disable peep-hole optimization.--peep-asm Pass the inline assembler code through the peephole optimizer. This can cause unexpected changes to inlineassembler code, please go through the peephole optimizerrules defined in the source file tree '<target>/peeph.def'before using this option.--iram-size<Value> Causes the linker to check if the interalram usage is within limits of the given value.--nostdincl This will prevent the compiler from passing onthe default include path to the preprocessor.--nostdlib This will prevent the compiler from passing onthe default library path to the linker.--verbose Shows the various actions the compiler is performing.-V Shows the actual commands the compiler is executing. Intermediate Dump OptionsThe following options are provided for the purpose of retargettingand debugging the compiler. These provided a means to dumpthe intermediate code (iCode) generated by the compilerin human readable form at various stages of the compilationprocess. --dumpraw This option will cause the compiler to dump theintermediate code into a file of named <source filename>.dumprawjust after the intermediate code has been generated fora function, i.e. before any optimizations are done. Thebasic blocks at this stage ordered in the depth first number,so they may not be in sequence of execution.--dumpgcse Will create a dump of iCode's, after global subexpressionelimination, into a file named <source filename>.dumpgcse.--dumpdeadcode Will create a dump of iCode's, after deadcodeelimination, into a file named <source filename>.dumpdeadcode.--dumploop Will create a dump of iCode's, after loop optimizations,into a file named <source filename>.dumploop.--dumprange Will create a dump of iCode's, after live rangeanalysis, into a file named <source filename>.dumprange.--dumlrange Will dump the life ranges for all symbols.--dumpregassign Will create a dump of iCode's, after registerassignment, into a file named <source filename>.dumprassgn.--dumplrange Will create a dump of the live ranges of iTemp's--dumpall Will cause all the above mentioned dumps to becreated. MCS51/DS390 Storage Class Language ExtensionsIn addition to the ANSI storage classes SDCC allows the followingMCS51 specific storage classes. xdataVariables declared with this storage class will be placedin the extern RAM. This is the default storage class forLarge Memory model, e.g.:xdata unsigned char xduc; dataThis is the default storage class for Small Memory model.Variables declared with this storage class will be allocatedin the internal RAM, e.g.:data int iramdata; idataVariables declared with this storage class will be allocatedinto the indirectly addressable portion of the internalram of a 8051, e.g.:idata int idi; bitThis is a data-type and a storage class specifier. When avariable is declared as a bit, it is allocated into thebit addressable memory of 8051, e.g.:bit iFlag; sfr / sbitLike the bit keyword, sfr / sbit signifies both a data-typeand storage class, they are used to describe the specialfunction registers and special bit variables of a 8051,eg:sfr at 0x80 P0; /* special function register P0 at location0x80 */sbit at 0xd7 CY; /* CY (Carry Flag) */ PointersSDCC allows (via language extensions) pointers to explicitlypoint to any of the memory spaces of the 8051. In additionto the explicit pointers, the compiler also allows a _genericclass of pointers which can be used to point to any of thememory spaces.Pointer declaration examples:/* pointer physically in xternal ram pointing to object ininternal ram */ data unsigned char * xdata p;/* pointer physically in code rom pointing to data in xdataspace */ xdata unsigned char * code p;/* pointer physically in code space pointing to data in codespace */ code unsigned char * code p;/* the folowing is a generic pointer physically located inxdata space */char * xdata p;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -