03-06-2015, 07:24 PM
I'm building a computer again - improved components, thankyou plot of logic (/warp pol). The architecture is still flexible: I want variable length instructions, some kind of pipelining, possibly a ring bus that routes dynamically with pistons (but that might turn into a contender for Minecraft's most elaborate clock).
I'm wondering if anybody has any advice about instruction set encoding. I'm looking to emulate the instruction set from the 6502.
Quick briefing: 8-bit opcodes, 1- to 3- byte variable length instructions. "Load to" and "store from" the accumulator (register) are examples of group I instructions and can have up to 16 addressing modes.
See how they've done that in the opcode table? LDA and STA have 2 possible values each for HI-NIBBLE (<A0, B0> and <80, 90>) and 4 possible shared values for LO_NIBBLE (<01, 05, 09, 0D>), giving 8 addressing modes.
Am I being arrogant in thinking of adapting this encoding? I'm thinking of what I'd call a simpler-to-understand encoding, like 1 HI-NIBBLE for LDA and 1 for STA. Is it a quirk of a particular physical 6502 implementation that led the designers to encode the way they did?
I'm wondering if anybody has any advice about instruction set encoding. I'm looking to emulate the instruction set from the 6502.
Quick briefing: 8-bit opcodes, 1- to 3- byte variable length instructions. "Load to" and "store from" the accumulator (register) are examples of group I instructions and can have up to 16 addressing modes.
See how they've done that in the opcode table? LDA and STA have 2 possible values each for HI-NIBBLE (<A0, B0> and <80, 90>) and 4 possible shared values for LO_NIBBLE (<01, 05, 09, 0D>), giving 8 addressing modes.
Am I being arrogant in thinking of adapting this encoding? I'm thinking of what I'd call a simpler-to-understand encoding, like 1 HI-NIBBLE for LDA and 1 for STA. Is it a quirk of a particular physical 6502 implementation that led the designers to encode the way they did?