Ed:
Below is the first row (LSN == 0x0) of the decode table:
Code:
----------------------------------------------------------------------------------
Row 0 : 0x00-0xF0 (All Bcc/JMP/JSR/RTS/RTI implemented as uninterruptable)
-- I BA, Wt, En, NA, PC, IO, DI, SP, Reg_WE, ISR
--------------------------------------------------------------------------------
_BRK_imm: BRV2 _Brk,0,1, Stk,, WR, PCH, Psh, WE_P -- Start Break Handler
_BPL_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_JSR_abs: BRV0 _JSR,0,1,, Pls, IF, OP1 -- Read Dst Ptr Lo
_BMI_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_RTI_imp: BRV0 _RTI,0,1, Stk,, RD, OP1, Pop -- Read PSW from Stack
_BVC_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_RTS_imp: BRV0 _RTS,0,1, Stk,, RD, OP1, Pop -- Read PCL from Stack
_BVS_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_BRA_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_BCC_rel BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_LDY_imm: BMW _Imm,0,1,, Pls, IF, OP1 -- Read #imm Value
_BCS_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_CPY_imm: BMW _Imm,0,1,, Pls, IF, OP1 -- Read #imm Value
_BNE_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
_CPX_imm: BMW _Imm,0,1,, Pls, IF, OP1 -- Read #imm Value
_BEQ_rel: BRV0 _Rel,0,1,, Rel, IF, OP1 -- Read rel Value
and below is the opcode decode table for the fifth row (LSN = 0x5):
Code:
--------------------------------------------------------------------------------
-- Row 5 : 0x05-0xF5-- I BA, Wt, En, NA, PC, IO, DI, SP, Reg_WE, ISR
--------------------------------------------------------------------------------
_ORA_dp: BRV0 _RO_DP,0,1,, Pls, IF, OP1 -- Read DP
_ORA_dpX: BRV0 _RO_DPX,0,1,, Pls, IF, OP1 -- Read DP
_AND_dp: BRV0 _RO_DP,0,1,, Pls, IF, OP1 -- Read DP
_AND_dpX: BRV0 _RO_DPX,0,1,, Pls, IF, OP1 -- Read DP
_EOR_dp: BRV0 _RO_DP,0,1,, Pls, IF, OP1 -- Read DP
_EOR_dpX: BRV0 _RO_DPX,0,1,, Pls, IF, OP1 -- Read DP
_ADC_dp: BRV0 _RO_DP,0,1,, Pls, IF, OP1 -- Read DP
_ADC_dpX: BRV0 _RO_DPX,0,1,, Pls, IF, OP1 -- Read DP
_STA_dp: BRV0 _WO_DP,0,1,, Pls, IF, OP1 -- Read DP
_STA_dpX: BRV0 _WO_DPX,0,1,, Pls, IF, OP1 -- Read DP
_LDA_dp: BRV0 _RO_DP,0,1,, Pls, IF, OP1 -- Read DP
_LDA_dpX: BRV0 _RO_DPX,0,1,, Pls, IF, OP1 -- Read DP
_CMP_dp: BRV0 _RO_DP,0,1,, Pls, IF, OP1 -- Read DP
_CMP_dpX: BRV0 _RO_DPX,0,1,, Pls, IF, OP1 -- Read DP
_SBC_dp: BRV0 _RO_DP,0,1,, Pls, IF, OP1 -- Read DP
_SBC_dpX: BRV0 _RO_DPX,0,1,, Pls, IF, OP1 -- Read DP
What you should notice is that when the decode table is organized in this fashion the opcodes are more closely related. This makes it much easier to create and verify the microcode. The first example defines most of the program control opcodes, and the second example defines the opcodes for zero page direct and zero page pre-indexed direct instructions. There are some inconsistencies, but the vast majority of the opcodes are related by type or by addressing mode when the opcodes are indexed by the MSN first and then the LSN. This means that the LSN and MSN are swapped.
Edit: deleted "the" from "defines the most" in the third sentence of last paragraph.