Teaching an LLM to Write Assembly: GBNF-Constrained Generation for a Custom 8-Bit CPU

The source code for this can be found on GitHub here. Over the past few weeks I’ve been building a fully-playable 8-bit virtual console from scratch — CPU, instruction set, assembler, sprite system, IDE, the lot. One of the more interesting side quests has been teaching an LLM to generate valid assembly targeting my CPU. You can follow the full build in my YouTube series here . Its called Building…