jackwthake/C02 ? reverse-engineered prompt
Reverse engineered prompt
Build me a small compiler toolchain for a C like language that targets the 65C02 and can run on the Ben Eater breadboard computer.
I want to be able to write simple programs with functions, structs, pointers, loops, if statements, recursion, globals, and basic math and bit operations, then compile them into a 32 KB ROM image I can load onto the machine. It should support separate files with includes, a basic standard library, a linker step, and a way to dump or inspect the generated assembly or intermediate output when something goes wrong.
Please make the whole thing feel like a real usable developer tool, with clear errors, a simple command line driver, and tests for the language features that are already supported. If you need to check current docs or assumptions for 65C02 details, go ahead and look them up online first.