Re:The 6502 instruction set as a database
by userbinator on Monday April 08, 2024 @09:32PM
(#39975497)
Table-driven assemblers (and disassemblers) have been a thing for a long time, especially for more obscure/embedded architectures. Reverse-engineering/analysis tools likewise have traditionally done the same, but with additional semantic information for each instruction. A quick search for table-driven compilers reveals some mid-century papers.
Ghidra uses SLEIGH for this purpose https://fossies.org/linux/ghidra/GhidraDocs/languages/html/s...
> A Language for Rapid Processor Specification
From a SLEIGH description, the assembler, disassembler, and even decompiler can be synthesized.
It's a DSL not a database schema, but fundamentally it's the same idea.
Here's their definition of the 6502: https://github.com/NationalSecurityAgency/ghidra/blob/cae919...
It's the first time I see an instruction set as a relational database, which I would imagine is a very portable way to describe a machine, perhaps it might be worth collecting other machine specs in that same format and then create a portable assembler that uses the specficic DBs.