/cc65-customizing-demo

Solution (and cleanup) for the `cc65` tutorial about creating a custom bare-metal 6502 build target

Primary LanguageAssembly

cc65-customizing-demo

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.

Repository Structure

  • .vscode/*: VSCode's workspace configurations

  • build/*: Location where make is instructed to dump all files from intermediate building stages, as well as the final 6502 ROM image

  • .gitignore: Tells git SCM to not care about tracking changes to any files from intermediate build stages and the 6502 ROM image

    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 the BRK 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 run make or make 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 at 0x1000 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 a wait() C function to make use of the 65C02 CPU core's WAI (Wait for Interrupt) instruction for halting until an interrupt is generated

Devlog