Next Previous Contents

2. 使用方法(Usage)

2.1 コマンドラインオプション概要

The assembler accepts the following options:

---------------------------------------------------------------------------
Usage: ca65 [options] file
短いオプション:
  -D name[=value]       シンボルを定義します。
  -I dir                インクルードディレクトリの検索パスを設定します。
  -U                    importと同様に、未解決のシンボルを作成します。
  -V                    アセンブラーのヴァージョンを出力します。
  -W n                  警告レベル(n)を設定します。
  -g                    オブジェクトファイルにデバッグ情報を追加します。
  -h                    ヘルプを表示します。(英文)
  -i                    シンボルのケースを無視します。
  -l                    アセンブリが正常にできたら、リスティングします。
  -mm model             メモリモデルを設定します。
  -o name               出力ファイル名(name)を指定します。
  -s                    スマートモードを有効にします。
  -t sys                ターゲット環境を設定します。
  -v                    詳細情報を出力します。

長いオプション:
  --auto-import         importと同様に、未解決のシンボルを作成します。
  --cpu type            CPUのタイプを設定します。
  --debug-info          オブジェクトファイルにデバッグ情報を追加します。
  --feature name        Set an emulation feature
  --forget-inc-paths    インクルードの検索パスを無視します。
  --help                ヘルプを表示します。(英文)
  --ignore-case         シンボルのケースを無視します。
  --include-dir dir     インクルードディレクトリの検索パスを設定します。
  --listing             アセンブリが正常にできたら、リスティングします。
  --list-bytes n        リスティングライン毎の最大バイト数
  --macpack-dir dir     Set a macro package directory
  --memory-model model  メモリモデルを設定します。
  --pagelength n        リスティングのページ長を設定します。
  --smart               スマートモードを有効にします。
  --target sys          ターゲット環境を設定します。
  --verbose             詳細情報を出力します。
  --version             アセンブラーのヴァージョンを出力します。
---------------------------------------------------------------------------

2.2 コマンドラインオプション詳細

長いコマンドラインオプションについて:

--cpu type

デフォルトのCPUを設定します。 このオプションには、以下の中からひとつのパラメータを指定します。

6502, 65SC02, 65C02, 65816, sunplus, sweet16, HuC6280

The sunplus cpu is not available in the freeware version, because the instruction set is "proprietary and confidential".

--feature name

Enable an emulation feature. This is identical as using .FEATURE in the source with two exceptions: Feature names must be lower case, and each feature must be specified by using an extra --feature option, comma separated lists are not allowed.

See the discussion of the .FEATURE command for a list of emulation features.

--forget-inc-paths

Forget the builtin include paths. This is most useful when building customized assembler modules, in which case the standard header files should be ignored.

-g, --debug-info

When this option (or the equivalent control command .DEBUGINFO) is used, the assembler will add a section to the object file that contains all symbols (including local ones) together with the symbol values and source file positions. The linker will put these additional symbols into the VICE label file, so even local symbols can be seen in the VICE monitor.

-h, --help

短いオプションを以下に表示します。

-i, --ignore-case

This option makes the assembler case insensitive on identifiers and labels. This option will override the default, but may itself be overridden by the .CASE control command.

-l, --listing

アセンブリ言語のリストを生成します。 The listing file will always have the name of the main input file with the extension replaced by ".lst". This may change in future versions.

--list-bytes n

Set the maximum number of bytes printed in the listing for one line of input. See the .LISTBYTES directive for more information. The value zero can be used to encode an unlimited number of printed bytes.

--macpack-dir dir

This options allows to specify a directory containing macro files that are used instead of the builtin images when a .MACPACK directive is encountered. If --macpack-dir was specified, a .mac extension is added to the package name and the resulting file is loaded from the given directory. This is most useful when debugging the builtin macro packages.

-mm model, --memory-model model

Define the default memory model. Possible model specifiers are near, far and huge.

-o name

デフォルトの出力ファイル名は、入力したファイル名に拡張子を".o"としたファイル名です。 もし、これが好ましくない場合、-oオプションにて名前を設定することができます。 出力ファイルは、ソースファイルと同じディレクトリに出力されます。 -oオプションにてフルパスを指定することも可能です。

--pagelength n

sets the length of a listing page in lines. See the .PAGELENGTH directive for more information.

-s, --smart-mode

In smart mode (enabled by -s or the .SMART pseudo instruction) the assembler will track usage of the REP and SEP instructions in 65816 mode and update the operand sizes accordingly. If the operand of such an instruction cannot be evaluated by the assembler (for example, because the operand is an imported symbol), a warning is issued.

Beware: Since the assembler cannot trace the execution flow this may lead to false results in some cases. If in doubt, use the .ixx and .axx instructions to tell the assembler about the current settings. Smart mode is off by default.

-t sys, --target sys

ターゲット・システムを設定します。
This will enable translation of character strings and character constants into the character set of the target platform. デフォルトのターゲットシステムは"none"で、which means that no translation will take place. アセンブラーは、コンパイラーと同じターゲットシステムをサポートし, see there for a list.

-v, --verbose

Increase the assembler verbosity. Usually only needed for debugging purposes. You may use this option more than one time for even more verbose output.

-D

This option allows you to define symbols on the command line. Without a value, the symbol is defined with the value zero. When giving a value, you may use the '$' prefix for hexadecimal symbols. Please note that for some operating systems, '$' has a special meaning, so you may have to quote the expression.

-I dir, --include-dir dir

Name a directory which is searched for include files. The option may be used more than once to specify more than one directory to search. The current directory is always searched first before considering any additional directories. See also the section about search paths.

-U, --auto-import

Mark symbols that are not defined in the sources as imported symbols. This should be used with care since it delays error messages about typos and such until the linker is run. The compiler uses the equivalent of this switch ( .AUTOIMPORT) to enable auto imported symbols for the runtime library. However, the compiler is supposed to generate code that runs through the assembler without problems, something which is not always true for assembler programmers.

-V, --version

Print the version number of the assembler. If you send any suggestions or bugfixes, please include the version number.

-Wn

Set the warning level for the assembler. Using -W2 the assembler will even warn about such things like unused imported symbols. The default warning level is 1, and it would probably be silly to set it to something lower.


Next Previous Contents