The 6502 only has 56 opcodes. The db also includes modern variants of the 6502.
I was referencing Simonw's post:
> Here are the 65 hardcoded opcodes
21–30 of 31 posts
The 6502 only has 56 opcodes. The db also includes modern variants of the 6502.
I was referencing Simonw's post:
> Here are the 65 hardcoded opcodes
The 6502 only has 56 opcodes. The db also includes modern variants of the 6502.
> The 6502 only has 56 opcodes In terms of bytes that the original CPU officially recognised as instructions, it was more like ~150 (working from old memories, I may be off by one or few there). Some of the other ~106 did something unofficially, and a number were valid instructions on later versions of the design. That ~150 were grouped into 56 instructions, many with multiple addressing modes (so "load A immediate",…
I assume you mean pedant.
Inspiring. I would love for the author's plan (pasted below) to get applied widely across key information sources: Instead, I hatched a plan: 1. Collect sources, and encoded the raw data in a machine-readable form 2. Study those sources, and encode my understanding as assertions, sanity-checks and validations of that data 3. Synthesise that data according to my understanding, and verify it against the sources availab…
I'm going to be thinking about this as the Discovery Manifesto.... or maybe the autodidactaliser.
I've found it useful to reexpress foreign knowledge in a familiar setting. The magic is possibly that the learning seems fun because the familiar tool is fairly easy to use and the new information is expressed in the familiar way.
It's also good because it's not cheap dopamine, like looking over Youtube videos.... I watched a video on the 6502... I know how it works now??.. Youtubes do have their place, but not at the expense of doing more in depth thinking.
Up next: 6502 emulator in a single SQL query
Not sure what the advantage is, relative to the tables as CSV files.
- emulators/simulators/FPGA code
- books, data sheets, OCR'd PDFs of books and data sheets, text files copy/pasted from PDFs or retyped from books and data sheets
Code is likely to be heavily tested, but it makes extracting high-level information about the instruction set very difficult.
Data is easy to analyse and synthesise, but since it's described in prose there's no easy way to test or validate it - if somebody in 1984 made a typo that a particular instruction took 3 cycles instead of 2, and that error was copy/pasted and made its way into half the "6502 instruction set" websites online, how would you know? How would you detect it?
Using SQL to enforce constraints and validation gives me confidence that there aren't a bunch of typos and copy/paste errors in this data. In addition, being able to express special cases like "read-modify-write instructions applying to the accumulator do not pay the three cycle penalty" in code rather than in prose makes it more likely they will be applied correctly. Lastly, since the result is an SQL database, it can be pretty easily formatted to resemble any book or data sheet you like for simplified visual verification against book/data sheet sources.
Inspiring. I would love for the author's plan (pasted below) to get applied widely across key information sources: Instead, I hatched a plan: 1. Collect sources, and encoded the raw data in a machine-readable form 2. Study those sources, and encode my understanding as assertions, sanity-checks and validations of that data 3. Synthesise that data according to my understanding, and verify it against the sources availab…
Something I realized years ago, the 6502 instruction set is small enough that it can be (almost) entirely implemented as memory look up — no actual logic computation need occur.
Since this is SQLite SQL, I copied it into a Gist (to give it CORS headers) and now you can open it directly in Datasette Lite (Datasette in WebAssembly running entirely in the browser): https://lite.datasette.io/?sql=https://gist.github.com/simon... Here are the 65 hardcoded opcodes: https://lite.datasette.io/?sql=https://gist.github.com/simon... And the 64 instructions: https://lite.datasette.io/?sql=https://gist.g…
Here's datasette lite running off that file:
https://lite.datasette.io/?parquet=https%3A%2F%2Fcsvbase.com...
Really nice when webby stuff works together
Earlier quoted context omitted.
> The 6502 only has 56 opcodes In terms of bytes that the original CPU officially recognised as instructions, it was more like ~150 (working from old memories, I may be off by one or few there). Some of the other ~106 did something unofficially, and a number were valid instructions on later versions of the design. That ~150 were grouped into 56 instructions, many with multiple addressing modes (so "load A immediate",…
The original 6502 had exactly 151 opcodes, the same as the number of pokémon in the original Pokémon games.
Earlier quoted context omitted.
> The 6502 only has 56 opcodes In terms of bytes that the original CPU officially recognised as instructions, it was more like ~150 (working from old memories, I may be off by one or few there). Some of the other ~106 did something unofficially, and a number were valid instructions on later versions of the design. That ~150 were grouped into 56 instructions, many with multiple addressing modes (so "load A immediate",…
> pendant I assume you mean pedant.
I really must stop writing things on the phone. I'm bad enough with a decent keyboard, sometimes I make sense at all via phone input.