3 ms·
Great idea, this could be valuable for people who write their own assembler. It's the first time I see an instruction set as a relational database, which I wou
by jll29 3y ago
Great idea, this could be valuable for people who write their own assembler.
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.
- userbinator 3y agoTable-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.
- Retr0id 3y agoGhidra uses SLEIGH for this purpose https://fossies.org/linux/ghidra/GhidraDocs/languages/html/sleigh.html 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/cae9190c13709fbd889edbe8f46d28c99df0a588/Ghidra/Processors/6502/data/languages/6502.slaspec https://github.com/NationalSecurityAgency/ghidra/blob/cae919...