Next Previous Contents

4. Custom Run-Time Library Creation

The next step in customizing the cc65 toolset is creating a run-time library for the targeted hardware. The easiest way to do this is to modify a standard library from the cc65 distribution. In this example, there is no console I/O, mouse, joystick, etc. in the system, so it is most appropriate to use the simplest library as the base, which is for the Watara Supervision and is named "supervision.lib" in the lib directory of the distribution.

The only modification required is to replace the crt0 module in the supervision.lib library with custom startup code. This is simply done by first copying the library and giving it a new name, compiling the startup code with ca65, and finally using the ar65 archiver to replace the module in the new library. The steps are shown below:

$ copy "C:\Program Files\cc65\lib\supervision.lib" sbc.lib
$ ca65 crt0.s
$ ar65 a sbc.lib crt0.o


Next Previous Contents