Tales of C, the 6502 and the BBC (with added python)
summary
Build claim: a working C compiler in python that emits native 6502 assembly for the BBC Micro, limited to simple C (no structs/unions/array init) and 16‑bit integers. Tools: a Python lexer/parser producing a 670‑node AST, an IR and register/stack codegen. Surprises: the 6502 has ~53 opcodes and needs a custom stack for pointer‑relative addressing, plus a hand‑rolled 16‑bit multiply. Outcome: compiler compiles to disk and can just‑in‑time compile and run on a real BBC Micro via SSH; recursion and basic globals work.
AI-written summary · about
chapters (5)
related talks
01h 20m“Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
41mHow to write a JIT compiler in 30 minutes
34mLearn How Computers Work Between Silicon and Assembly: Build a CPU with Python
01h 13mHow to write a programming language
49mYou Used Python for What?!
56mScripting the Internet of Things
01h 00mJust Enough Assembly for Compiler Explorer
45mC++ is a Metacompiler
