Next Previous Contents

## 2. Usage

The co65 utility converts one o65 file per run into one assembler files in ca65 format. The utility tries to autodetect the type of the o65 input file using the operating system identifier contained in the o65 option list.

## 2.1 Command line option overview

The converter may be called as follows:

> `

>     ---------------------------------------------------------------------------
>     Usage: co65 [options] file
>     Short options:
>       -V                    Print the version number
>       -g                    Add debug info to object file
>       -h                    Help (this text)
>       -m model              Override the o65 model
>       -n                    Don't generate an output file
>       -o name               Name the output file
>       -v                    Increase verbosity

>     Long options:
>       --bss-label name      Define and export a BSS segment label
>       --bss-name seg        Set the name of the BSS segment
>       --code-label name     Define and export a CODE segment label
>       --code-name seg       Set the name of the CODE segment
>       --data-label name     Define and export a DATA segment label
>       --data-name seg       Set the name of the DATA segment
>       --debug-info          Add debug info to object file
>       --help                Help (this text)
>       --no-output           Don't generate an output file
>       --o65-model model     Override the o65 model
>       --verbose             Increase verbosity
>       --version             Print the version number
>       --zeropage-label name Define and export a ZEROPAGE segment label
>       --zeropage-name seg   Set the name of the ZEROPAGE segment
>     ---------------------------------------------------------------------------

> `

## 2.2 Command line options in detail

Here is a description of all the command line options:

`--bss-label name`

  Set the label used to mark the start of the bss segment. When this option is given, the label is also exported and may be accessed from other code. When accessing such a label from C code, be sure to include the leading underscore. If you don't need to access the bss segment, there's no need to use this option.

`--bss-name seg`

  Set the name of the bss segment. The default name is "BSS" which is compatible with the standard ld65 linker configurations.

`--code-label name`

  Set the label used to mark the start of the code segment. When this option is given, the label is also exported and may be accessed from other code. When accessing such a label from C code, be sure to include the leading underscore. If you don't need to access the code segment, there's no need to use this option.

`--code-name seg`

  Set the name of the code segment. The default name is "CODE" which is compatible with the standard ld65 linker configurations.

`--data-label name`

  Set the label used to mark the start of the data segment. When this option is given, the label is also exported and may be accessed from other code. When accessing such a label from C code, be sure to include the leading underscore. If you don't need to access the data segment, there's no need to use this option.

`--data-name seg`

  Set the name of the data segment. The default name is "DATA" which is compatible with the standard ld65 linker configurations.

`-d, --debug`

  Enables debug mode, something that should not be needed for mere mortals. Currently the converter does only accept cc65 loadable modules generated by ld65 when not in debug mode. Please note that correct conversion has never been tested for o65 files from other sources, so be careful when using `-d`.

`-g, --debug-info`

  This will cause the converter to insert a `.DEBUGINFO` command into the generated assembler code. This will cause the assembler to include all symbols in a special section in the object file.

`-h, --help`

  Print the short option summary shown above.

`-m model, --o65-model model`

  Set an o65 model. This option changes the way, output is generated for the given o65 file. For example, cc65 loadable drivers have a zero page segment, but this segment must not be defined in the file itself, because the standard module loader will overlay it with the zeropage space used by the application that loads this module. So instead of allocating space in the zero page segment, the converter will reference the start of the zero page area used by the application.

  Currently, the following models are defined:

  - lunix
  - os/a65
  - cc65-module

  The default is to autodetect the model to use from the input file, so there's rarely a need to use this option.

`-n, --no-output`

  Don't do the actual conversion, just read in the o65 file checking for problems. This option may be used in conjunction with `--verbose` to view some information about the input file.

`-o name`

  Specify the name of the output file. If you don't specify a name, the name of the o65 input file is used, with the extension replaced by ".s".

`-v, --verbose`

  Using this option, the converter will be somewhat more verbose and print some information about the o65 input file (among other things). You may use this option together with `--no-output` to just get the o65 info.

`-V, --version`

  Print the version number of the compiler. When submitting a bug report, please include the operating system you're using, and the compiler version.

`--zeropage-label name`

  Set the label used to mark the start of the zeropage segment. When this option is given, the label is also exported and may be accessed from other code. When accessing such a label from C code, be sure to include the leading underscore. If you don't need to access the zeropage segment, there's no need to use this option.

`--zeropage-name seg`

  Set the name of the data segment. The default name is "ZEROPAGE" which is compatible with the standard ld65 linker configurations.

Next Previous Contents