Next Previous Contents

3. How to prepare your programs

VICE support is mostly done via a label file that is generated by the linker and that may be read by the VICE monitor, so it knows about your program. Source level debugging is not available, you have to debug your programs in the assembler view.

The first step is to generate object files that contain information about all labels in your sources, not just the exported ones. This can be done by several means:

So, if you have just C code, all you need is to invoke the compiler with -g. If you're using assembler code, you have to use -g for the assembler, or add ".debuginfo on" to your source files. Since the generated debug info is not appended to the generated executables, it is a good idea to always use -g. It makes the object files and libraries slightly larger (~30%), but this is usually not a problem.

The second step is to tell the linker that it should generate a VICE label file. This is done by the -Ln switch followed by the name of the label file (I'm usually using a .lbl extension for these files). An example for a linker command line would be:

    ld65 -t c64 -Ln hello.lbl -m -o hello crt0 hello.o c64.lib

This will generate a file named hello.lbl that contains all symbols used in your program.

Note: The runtime libraries and startup files were generated with debug info, so you don't have to care about this.

Next Previous Contents