We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
Super FX Opcode Matrices
From SnesLab
The Super FX has two prefix flags called ALT1 and ALT2 that alter the way the GSU interprets opcodes. These four opcode matrices will show which instruction actually runs depending on how those prefix flags are set.
Note: These matrices are under construction, created from the official dev manual, and are untested on hardware. What instruction happens when an ALT flag/opcode combination which has no dedicated page in the manual runs is particularly unverified. (Some of these are denoted with ?) (edit: fullsnes has a section on "Ignored Prefixes")[1]
The placement of XOR and UMULT immediate is also an educated guess.
ALT1 = 0, ALT2 = 0 (aka ALT0)
x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x | STOP | NOP | CACHE | LSR | ROL | BRA | BGE | BLT | BNE | BEQ | BPL | BMI | BCC | BCS | BVC | BVS |
1x | TO R0 | TO R1 | TO R2 | TO R3 | TO R4 | TO R5 | TO R6 | TO R7 | TO R8 | TO R9 | TO R10 | TO R11 | TO R12 | TO R13 | TO R14 | TO R15 |
2x | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE | MOVE |
3x | STW (R0) | STW (R1) | STW (R2) | STW (R3) | STW (R4) | STW (R5) | STW (R6) | STW (R7) | STW (R8) | STW (R9) | STW (R10) | STW (R11) | LOOP | ALT1 | ALT2 | ALT3 |
4x | LDW (R0) | LDW (R1) | LDW (R2) | LDW (R3) | LDW (R4) | LDW (R5) | LDW (R6) | LDW (R7) | LDW (R8) | LDW (R9) | LDW (R10) | LDW (R11) | PLOT | SWAP | COLOR | NOT |
5x | ADD R0 | ADD R1 | ADD R2 | ADD R3 | ADD R4 | ADD R5 | ADD R6 | ADD R7 | ADD R8 | ADD R9 | ADD R10 | ADD R11 | ADD R12 | ADD R13 | ADD R14 | ADD R15 |
6x | SUB R0 | SUB R1 | SUB R2 | SUB R3 | SUB R4 | SUB R5 | SUB R6 | SUB R7 | SUB R8 | SUB R9 | SUB R10 | SUB R11 | SUB R12 | SUB R13 | SUB R14 | SUB R15 |
7x | MERGE | AND R1 | AND R2 | AND R3 | AND R4 | AND R5 | AND R6 | AND R7 | AND R8 | AND R9 | AND R10 | AND R11 | AND R12 | AND R13 | AND R14 | AND R15 |
8x | MULT R0 | MULT R1 | MULT R2 | MULT R3 | MULT R4 | MULT R5 | MULT R6 | MULT R7 | MULT R8 | MULT R9 | MULT R10 | MULT R11 | MULT R12 | MULT R13 | MULT R14 | MULT R15 |
9x | SBK | LINK #1 | LINK #2 | LINK #3 | LINK #4 | SEX | ASR | ROR | JMP R8 | JMP R9 | JMP R10 | JMP R11 | JMP R12 | JMP R13 | LOB | FMULT |
Ax | IBT R0 | IBT R1 | IBT R2 | IBT R3 | IBT R4 | IBT R5 | IBT R6 | IBT R7 | IBT R8 | IBT R9 | IBT R10 | IBT R11 | IBT R12 | IBT R13 | IBT R14 | IBT R15 |
Bx | FROM R0 | FROM R1 | FROM R2 | FROM R3 | FROM R4 | FROM R5 | FROM R6 | FROM R7 | FROM R8 | FROM R9 | FROM R10 | FROM R11 | FROM R12 | FROM R13 | FROM R14 | FROM R15 |
Cx | HIB | OR R1 | OR R2 | OR R3 | OR R4 | OR R5 | OR R6 | OR R7 | OR R8 | OR R9 | OR R10 | OR R11 | OR R12 | OR R13 | OR R14 | OR R15 |
Dx | INC R0 | INC R1 | INC R2 | INC R3 | INC R4 | INC R5 | INC R6 | INC R7 | INC R8 | INC R9 | INC R10 | INC R11 | INC R12 | INC R13 | INC R14 | GETC |
Ex | DEC R0 | DEC R1 | DEC R2 | DEC R3 | DEC R4 | DEC R5 | DEC R6 | DEC R7 | DEC R8 | DEC R9 | DEC R10 | DEC R11 | DEC R12 | DEC R13 | DEC R14 | GETB |
Fx | IWT R0, #xx | IWT R1, #xx | IWT R2, #xx | IWT R3, #xx | IWT R4, #xx | IWT R5, #xx | IWT R6, #xx | IWT R7, #xx | IWT R8, #xx | IWT R9, #xx | IWT R10, #xx | IWT R11, #xx | IWT R12, #xx | IWT R13, #xx | IWT R14, #xx | IWT R15, #xx |
ALT1 = 0, ALT2 = 1
x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x | STOP | NOP | CACHE | LSR | ROL | BRA | BGE | BLT | BNE | BEQ | BPL | BMI | BCC | BCS | BVC | BVS |
1x | TO R0 | TO R1 | TO R2 | TO R3 | TO R4 | TO R5 | TO R6 | TO R7 | TO R8 | TO R9 | TO R10 | TO R11 | TO R12 | TO R13 | TO R14 | TO R15 |
2x | ||||||||||||||||
3x | LOOP | ALT1 | ALT2 | ALT3 | ||||||||||||
4x | PLOT | SWAP | COLOR | NOT | ||||||||||||
5x | ||||||||||||||||
6x | SUB #0 | SUB #1 | SUB #2 | SUB #3 | SUB #4 | SUB #5 | SUB #6 | SUB #7 | SUB #8 | SUB #9 | SUB #10 | SUB #11 | SUB #12 | SUB #13 | SUB #14 | SUB #15 |
7x | MERGE | AND #1 | AND #2 | AND #3 | AND #4 | AND #5 | AND #6 | AND #7 | AND #8 | AND #9 | AND #10 | AND #11 | AND #12 | AND #13 | AND #14 | AND #15 |
8x | MULT #0 | MULT #1 | MULT #2 | MULT #3 | MULT #4 | MULT #5 | MULT #6 | MULT #7 | MULT #8 | MULT #9 | MULT #10 | MULT #11 | MULT #12 | MULT #13 | MULT #14 | MULT #15 |
9x | SBK | LINK #1 | LINK #2 | LINK #3 | LINK #4 | SEX | ASR | ROR | LOB | FMULT | ||||||
Ax | IBT R0 | IBT R1 | IBT R2 | IBT R3 | IBT R4 | IBT R5 | IBT R6 | IBT R7 | IBT R8 | IBT R9 | IBT R10 | IBT R11 | IBT R12 | IBT R13 | IBT R14 | IBT R15 |
Bx | FROM R0 | FROM R1 | FROM R2 | FROM R3 | FROM R4 | FROM R5 | FROM R6 | FROM R7 | FROM R8 | FROM R9 | FROM R10 | FROM R11 | FROM R12 | FROM R13 | FROM R14 | FROM R15 |
Cx | HIB | OR #1 | OR #2 | OR #3 | OR #4 | OR #5 | OR #6 | OR #7 | OR #8 | OR #9 | OR #10 | OR #11 | OR #12 | OR #13 | OR #14 | OR #15 |
Dx | INC R0 | INC R1 | INC R2 | INC R3 | INC R4 | INC R5 | INC R6 | INC R7 | INC R8 | INC R9 | INC R10 | INC R11 | INC R12 | INC R13 | INC R14 | RAMB |
Ex | DEC R0 | DEC R1 | DEC R2 | DEC R3 | DEC R4 | DEC R5 | DEC R6 | DEC R7 | DEC R8 | DEC R9 | DEC R10 | DEC R11 | DEC R12 | DEC R13 | DEC R14 | GETBL |
Fx | IWT R0, #xx | IWT R1, #xx | IWT R2, #xx | IWT R3, #xx | IWT R4, #xx | IWT R5, #xx | IWT R6, #xx | IWT R7, #xx | IWT R8, #xx | IWT R9, #xx | IWT R10, #xx | IWT R11, #xx | IWT R12, #xx | IWT R13, #xx | IWT R14, #xx | IWT R15, #xx |
ALT1 = 1, ALT2 = 0
x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x | STOP | NOP | CACHE | LSR | ROL | BRA | BGE | BLT | BNE | BEQ | BPL | BMI | BCC | BCS | BVC | BVS |
1x | TO R0 | TO R1 | TO R2 | TO R3 | TO R4 | TO R5 | TO R6 | TO R7 | TO R8 | TO R9 | TO R10 | TO R11 | TO R12 | TO R13 | TO R14 | TO R15 |
2x | ||||||||||||||||
3x | STB (R0) | STB (R1) | STB (R2) | STB (R3) | STB (R4) | STB (R5) | STB (R6) | STB (R7) | STB (R8) | STB (R9) | STB (R10) | STB (R11) | LOOP | ALT1 | ALT2 | ALT3 |
4x | RPIX | SWAP | CMODE | NOT | ||||||||||||
5x | ADC R0 | ADC R1 | ADC R2 | ADC R3 | ADC R4 | ADC R5 | ADC R6 | ADC R7 | ADC R8 | ADC R9 | ADC R10 | ADC R11 | ADC R12 | ADC R13 | ADC R14 | ADC R15 |
6x | ||||||||||||||||
7x | MERGE | |||||||||||||||
8x | UMULT R0 | UMULT R1 | UMULT R2 | UMULT R3 | UMULT R4 | UMULT R5 | UMULT R6 | UMULT R7 | UMULT R8 | UMULT R9 | UMULT R10 | UMULT R11 | UMULT R12 | UMULT R13 | UMULT R14 | UMULT R15 |
9x | SBK | LINK #1 | LINK #2 | LINK #3 | LINK #4 | SEX | DIV2 | ROR | LJMP R8 | LJMP R9 | LJMP R10 | LJMP R11 | LJMP R12 | LJMP R13 | LOB | FMULT |
Ax | IBT R0 | IBT R1 | IBT R2 | IBT R3 | IBT R4 | IBT R5 | IBT R6 | IBT R7 | IBT R8 | IBT R9 | IBT R10 | IBT R11 | IBT R12 | IBT R13 | IBT R14 | IBT R15 |
Bx | FROM R0 | FROM R1 | FROM R2 | FROM R3 | FROM R4 | FROM R5 | FROM R6 | FROM R7 | FROM R8 | FROM R9 | FROM R10 | FROM R11 | FROM R12 | FROM R13 | FROM R14 | FROM R15 |
Cx | HIB | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR |
Dx | INC R0 | INC R1 | INC R2 | INC R3 | INC R4 | INC R5 | INC R6 | INC R7 | INC R8 | INC R9 | INC R10 | INC R11 | INC R12 | INC R13 | INC R14 | GETC |
Ex | DEC R0 | DEC R1 | DEC R2 | DEC R3 | DEC R4 | DEC R5 | DEC R6 | DEC R7 | DEC R8 | DEC R9 | DEC R10 | DEC R11 | DEC R12 | DEC R13 | DEC R14 | GETBH |
Fx | IWT R0, #xx | IWT R1, #xx | IWT R2, #xx | IWT R3, #xx | IWT R4, #xx | IWT R5, #xx | IWT R6, #xx | IWT R7, #xx | IWT R8, #xx | IWT R9, #xx | IWT R10, #xx | IWT R11, #xx | IWT R12, #xx | IWT R13, #xx | IWT R14, #xx | IWT R15, #xx |
ALT1 = 1, ALT2 = 1 (aka ALT3)
x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x | STOP | NOP | CACHE | LSR | ROL | BRA | BGE | BLT | BNE | BEQ | BPL | BMI | BCC | BCS | BVC | BVS |
1x | TO R0 | TO R1 | TO R2 | TO R3 | TO R4 | TO R5 | TO R6 | TO R7 | TO R8 | TO R9 | TO R10 | TO R11 | TO R12 | TO R13 | TO R14 | TO R15 |
2x | ||||||||||||||||
3x | LOOP | ALT1 | ALT2 | ALT3 | ||||||||||||
4x | PLOT ? | SWAP | COLOR ? | NOT | ||||||||||||
5x | ||||||||||||||||
6x | CMP R0 | CMP R1 | CMP R2 | CMP R3 | CMP R4 | CMP R5 | CMP R6 | CMP R7 | CMP R8 | CMP R9 | CMP R10 | CMP R11 | CMP R12 | CMP R13 | CMP R14 | CMP R15 |
7x | MERGE | BIC #1 | BIC #2 | BIC #3 | BIC #4 | BIC #5 | BIC #6 | BIC #7 | BIC #8 | BIC #9 | BIC #10 | BIC #11 | BIC #12 | BIC #13 | BIC #14 | BIC #15 |
8x | UMULT #0 | UMULT #1 | UMULT #2 | UMULT #3 | UMULT #4 | UMULT #5 | UMULT #6 | UMULT #7 | UMULT #8 | UMULT #9 | UMULT #10 | UMULT #11 | UMULT #12 | UMULT #13 | UMULT #14 | UMULT #15 |
9x | SBK | LINK #1 | LINK #2 | LINK #3 | LINK #4 | SEX | DIV2 ? | ROR | LOB | FMULT | ||||||
Ax | IBT R0 | IBT R1 | IBT R2 | IBT R3 | IBT R4 | IBT R5 | IBT R6 | IBT R7 | IBT R8 | IBT R9 | IBT R10 | IBT R11 | IBT R12 | IBT R13 | IBT R14 | IBT R15 |
Bx | FROM R0 | FROM R1 | FROM R2 | FROM R3 | FROM R4 | FROM R5 | FROM R6 | FROM R7 | FROM R8 | FROM R9 | FROM R10 | FROM R11 | FROM R12 | FROM R13 | FROM R14 | FROM R15 |
Cx | HIB | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR | XOR |
Dx | INC R0 | INC R1 | INC R2 | INC R3 | INC R4 | INC R5 | INC R6 | INC R7 | INC R8 | INC R9 | INC R10 | INC R11 | INC R12 | INC R13 | INC R14 | ROMB |
Ex | DEC R0 | DEC R1 | DEC R2 | DEC R3 | DEC R4 | DEC R5 | DEC R6 | DEC R7 | DEC R8 | DEC R9 | DEC R10 | DEC R11 | DEC R12 | DEC R13 | DEC R14 | GETBS |
Fx | IWT R0, #xx | IWT R1, #xx | IWT R2, #xx | IWT R3, #xx | IWT R4, #xx | IWT R5, #xx | IWT R6, #xx | IWT R7, #xx | IWT R8, #xx | IWT R9, #xx | IWT R10, #xx | IWT R11, #xx | IWT R12, #xx | IWT R13, #xx | IWT R14, #xx | IWT R15, #xx |