Contains the result of following the cc65
project's tutorial defining a custom target for a "bare-metal" 65C02 (but actually using the 65SC02 instruction set) and building a "Hello World!" program for it.
-
.vscode/*
: VSCode's workspace configurations -
build/*
: Location wheremake
is instructed to dump all files from intermediate building stages, as well as the final6502
ROM image -
.gitignore
: Tellsgit
SCM to not care about tracking changes to any files from intermediate build stages and the6502
ROM imagecrt0.s
: 6502 Assembly containing the logic required to initialize the C runtime environment and clean it up if/when the Cmain()
function exits
NOTE: This is actually the entry point to the program and directly calls the
main()
function -
interrupts.s
: 6502 Assembly with a custom ISR that can differentiate between valid interrupts and those generated by theBRK
instruction (indicating a software fault), which should result in halting the CPU -
main.c
: C source file containing an example program sending an RS232 message for every received'?'
character -
Makefile
: Automated project build instructions, just runmake
ormake all
to compile a ROM image at./build/6502
-
README.md
: Here! -
rs232_tx.s
: 6502 Assembly containing an example hardware driver for a hypothetical RS232 perhipheral string storage (located at0x1000
and taking FIFO messages, theorized to be an FPGA with a UART HDL program) -
sbc.cfg
: Linker configuration file describing the layout of different memory segments and their properties -
vectors.s
: 6502 Assembly placing the symbols of applicable ISR and reset vectors into the correct addresses in the 6502 vector table -
wait.s
: 6502 Assembly creating await()
C function to make use of the 65C02 CPU core'sWAI
(Wait for Interrupt) instruction for halting until an interrupt is generated
- On WSL:
cp /usr/share/cc65/lib/supervision.lib sbc.lib
- In
sbc.cfg
'sSYMBOLS
section, the tutorial says to useweak = yes
, but this should likely betype = weak