cc65 is a complete cross development package for 65(C)02 systems, including a powerful macro assembler, a C compiler, linker, librarian and several other tools.
cc65 has C and runtime library support for many of the old 6502 machines, including
- the following Commodore machines:
- VIC20
- C16/C116 and Plus/4
- C64
- C128
- CBM 510 (aka P500)
- the 600/700 family
- newer PET machines (not 2001).
- the Apple ][+ and successors.
- the Atari 8 bit machines.
- the Atari 5200 console.
- GEOS for the C64, C128 and Apple //e.
- the NEC PC-Engine (aka TurboGrafx-16).
- the Nintendo Entertainment System (NES) console.
- the Supervision console.
- the Oric Atmos.
- the Lynx console.
- the Ohio Scientific Challenger 1P
The libraries are fairly portable, so creating a version for other 6502s shouldn't be too much work.
- You need to generate a 4 bytes DOS 3.3 binary file prefix
Place these 4 lines at the beginning of your source file:
__MAIN = $1000 ; Apple DOS 3.3 binary file 4 byte prefix header
.word __MAIN ; 2 byte BLAOD address
.word __END - __MAIN ; 2 byte BLOAD size
.org __MAIN ; .org must come after header else offsets are wrong
Or the simpler 2-liner:
__MAIN = $1000
.include "dos33.h" ; Apple DOS 3.3 binary file 4 byte prefix header
-
If you want the ability to BRUN your binary and return to DOS when done you need to use
JMP $3D0
instead of anRTS
. (If you really want to useRTS
you will first need to BLOAD your binary and then run it manually with an ApplesoftCALL
or monitor####G
command.) -
If you use
a2tools
you need to use a2tools in "raw" mode -
If you need text with the high-bit set use the macro ASC in barebones.s
- See the directory apple2 for more details.