ca65-2.html
来自「cc65 的编译器文档」· HTML 代码 · 共 194 行
HTML
194 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD> <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20"> <TITLE>ca65 Users Guide: Usage</TITLE> <LINK HREF="ca65-3.html" REL=next> <LINK HREF="ca65-1.html" REL=previous> <LINK HREF="ca65.html#toc2" REL=contents></HEAD><BODY><A HREF="ca65-3.html">Next</A><A HREF="ca65-1.html">Previous</A><A HREF="ca65.html#toc2">Contents</A><HR><H2><A NAME="s2">2.</A> <A HREF="ca65.html#toc2">Usage</A></H2><H2><A NAME="ss2.1">2.1</A> <A HREF="ca65.html#toc2.1">Command line option overview</A></H2><P>The assembler accepts the following options:</P><P><BLOCKQUOTE><CODE><PRE>---------------------------------------------------------------------------Usage: ca65 [options] fileShort options: -D name[=value] Define a symbol -I dir Set an include directory search path -U Mark unresolved symbols as import -V Print the assembler version -W n Set warning level n -g Add debug info to object file -h Help (this text) -i Ignore case of symbols -l Create a listing if assembly was ok -o name Name the output file -s Enable smart mode -t sys Set the target system -v Increase verbosityLong options: --auto-import Mark unresolved symbols as import --cpu type Set cpu type --debug-info Add debug info to object file --feature name Set an emulation feature --help Help (this text) --ignore-case Ignore case of symbols --include-dir dir Set an include directory search path --listing Create a listing if assembly was ok --pagelength n Set the page length for the listing --smart Enable smart mode --target sys Set the target system --verbose Increase verbosity --version Print the assembler version---------------------------------------------------------------------------</PRE></CODE></BLOCKQUOTE></P><H2><A NAME="ss2.2">2.2</A> <A HREF="ca65.html#toc2.2">Command line options in detail</A></H2><P>Here is a description of all the command line options:</P><P><DL><P><A NAME="option--cpu"></A> </P><DT><B><CODE>--cpu type</CODE></B><DD><P>Set the default for the CPU type. The option takes a parameter, whichmay be one of</P><P>6502, 65SC02, 65C02, 65816 and sunplus</P><P>The last one (sunplus) is not available in the freeware version, because theinstruction set of the sunplus CPU is "proprietary and confidential".</P><P><A NAME="option--feature"></A> </P><DT><B><CODE>--feature name</CODE></B><DD><P>Enable an emulation feature. This is identical as using <CODE>.FEATURE</CODE>in the source with two exceptions: Feature names must be lower case, andeach feature must be specified by using an extra <CODE>--feature</CODE> option,comma separated lists are not allowed.</P><P>See the discussion of the <CODE><A HREF="ca65-10.html#.FEATURE">.FEATURE</A></CODE>command for a list of emulation features.</P><P><A NAME="option-g"></A> </P><DT><B><CODE>-g, --debug-info</CODE></B><DD><P>When this option (or the equivalent control command <CODE>.DEBUGINFO</CODE>) isused, the assembler will add a section to the object file that containsall symbols (including local ones) together with the symbol values andsource file positions. The linker will put these additional symbols intothe VICE label file, so even local symbols can be seen in the VICEmonitor.</P><DT><B><CODE>-h, --help</CODE></B><DD><P>Print the short option summary shown above.</P><DT><B><CODE>-i, --ignore-case</CODE></B><DD><P>This option makes the assembler case insensitive on identifiers and labels.This option will override the default, but may itself be overriden by the<CODE><A HREF="ca65-10.html#.CASE">.CASE</A></CODE> control command.</P><DT><B><CODE>-l, --listing</CODE></B><DD><P>Generate an assembler listing. The listing file will always have thename of the main input file with the extension replaced by ".lst". Thismay change in future versions.</P><DT><B><CODE>-o name</CODE></B><DD><P>The default output name is the name of the input file with the extensionreplaced by ".o". If you don't like that, you may give another name withthe -o option. The output file will be placed in the same directory asthe source file, or, if -o is given, the full path in this name is used.</P><DT><B><CODE>--pagelength n</CODE></B><DD><P>sets the length of a listing page in lines. See the <CODE><A HREF="ca65-10.html#.PAGELENGTH">.PAGELENGTH</A></CODE> directive for more information.</P><DT><B><CODE>-s, --smart-mode</CODE></B><DD><P>In smart mode (enabled by -s or the <CODE><A HREF="ca65-10.html#.SMART">.SMART</A></CODE>pseudo instruction) the assembler will track usage of the <CODE>REP</CODE> and<CODE>SEP</CODE> instructions in 65816 mode and update the operand sizesaccordingly. If the operand of such an instruction cannot be evaluated bythe assembler (for example, because the operand is an imported symbol), awarning is issued.</P><P>Beware: Since the assembler cannot trace the execution flow this maylead to false results in some cases. If in doubt, use the .ixx and .axxinstructions to tell the assembler about the current settings. Smartmode is off by default.</P><P><A NAME="option-t"></A> </P><DT><B><CODE>-t sys, --target sys</CODE></B><DD><P>Set the target system. This will enable translation of character stringsand character constants into the character set of the target platform.The default for the target system is "none", which means that no translationwill take place. The assembler supports the same target systems as thecompiler, see there for a list.</P><DT><B><CODE>-v, --verbose</CODE></B><DD><P>Increase the assembler verbosity. Usually only needed for debuggingpurposes. You may use this option more than one time for even moreverbose output.</P><DT><B><CODE>-D</CODE></B><DD><P>This option allows you to define symbols on the command line. Without avalue, the symbol is defined with the value zero. When giving a value,you may use the '$' prefix for hexadecimal symbols. Please notethat for some operating systems, '$' has a special meaning, soyou may have to quote the expression.</P><DT><B><CODE>-I dir, --include-dir dir</CODE></B><DD><P>Name a directory which is searched for include files. The option may beused more than once to specify more than one directory to search. Thecurrent directory is always searched first before considering anyadditional directores.</P><DT><B><CODE>-U, --auto-import</CODE></B><DD><P>Mark symbols that are not defined in the sources as imported symbols. Thisshould be used with care since it delays error messages about typos and suchuntil the linker is run. The compiler uses the equivalent of this switch(<CODE><A HREF="ca65-10.html#.AUTOIMPORT">.AUTOIMPORT</A></CODE>) to enable auto importedsymbols for the runtime library. However, the compiler is supposed togenerate code that runs through the assembler without problems, somethingwhich is not always true for assembler programmers.</P><DT><B><CODE>-V, --version</CODE></B><DD><P>Print the version number of the assembler. If you send any suggestionsor bugfixes, please include the version number.</P><P><A NAME="option-W"></A> </P><DT><B><CODE>-Wn</CODE></B><DD><P>Set the warning level for the assembler. Using -W2 the assembler willeven warn about such things like unused imported symbols. The defaultwarning level is 1, and it would probably be silly to set it tosomething lower.</P></DL></P><HR><A HREF="ca65-3.html">Next</A><A HREF="ca65-1.html">Previous</A><A HREF="ca65.html#toc2">Contents</A></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?