Next Previous Contents

## 4. Target specific stuff

For each supported system there's a header file that contains calls or defines specific for this system. So, when programming for the C64, include c64.h, for the C128, include c128.h and so on. To make the task for the Commodore systems easier, there is also a header file named cbm.h that will define stuff common for all CBM systems, and include the header file for the specific target system.

The header files contain

- Defines for special keys (like function keys)
- Defines for special characters (like the graphics characters)
- Variables with a fixed address in memory that may be used to access special hardware. For the C64 and C128 there is a variable struct named `SID`. Writing to the fields of this struct will write to the SID device instead. Using these variables will make your program more readable and more portable. Don't fear ineffective code when using these variables, the compiler will translate reads and writes to these structs into direct memory accesses.
- Other routines that make only sense for a specific system. One example are routines to write memory locations in the system bank for the CBM PET-II family.

Next Previous Contents