News for hackers. Stuff that matters.
Re:The 6502 instruction set as a database by jll29 on Monday April 08, 2024 @05:15PM (#39973802)
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.

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.
Re:The 6502 instruction set as a database by Retr0id on Monday April 08, 2024 @09:38PM (#39975530)
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...