[RSP] installed REGIMM mnemonics matrix to the command stepper

This commit is contained in:
unknown 2015-06-19 23:59:36 -04:00
parent 55b3edd6d1
commit 2335b7b0e7
1 changed files with 34 additions and 28 deletions

View File

@ -814,6 +814,12 @@ static const char* mnemonics_special[8 << 3] = {
unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op, unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,
unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op, unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,
};/* 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 */ };/* 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 */
static const char* mnemonics_regimm[8 << 2] = {
"BLTZ" ,"BGEZ" ,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,
unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,
"BLTZAL" ,"BGEZAL" ,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,
unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,unused_op,
};/* 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 */
char * RSPSpecialName ( DWORD OpCode, DWORD PC ) char * RSPSpecialName ( DWORD OpCode, DWORD PC )
{ {
@ -915,35 +921,35 @@ char * RSPRegimmName ( DWORD OpCode, DWORD PC )
{ {
OPCODE command; OPCODE command;
command.Hex = OpCode; command.Hex = OpCode;
switch (command.rt) if (strcmp(mnemonics_regimm[command.rt], unused_op) == 0)
{ {
case RSP_REGIMM_BLTZ: sprintf(
sprintf(CommandName,"BLTZ\t%s, 0x%03X",GPR_Name(command.rs), CommandName,
(PC + ((short)command.offset << 2) + 4) & 0xFFC); "RSP: Unknown\t%02X %02X %02X %02X",
break; command.Ascii[3],
case RSP_REGIMM_BGEZ: command.Ascii[2],
sprintf(CommandName,"BGEZ\t%s, 0x%03X",GPR_Name(command.rs), command.Ascii[1],
(PC + ((short)command.offset << 2) + 4) & 0xFFC); command.Ascii[0]
break; );
case RSP_REGIMM_BLTZAL: }
sprintf(CommandName,"BLTZAL\t%s, 0x%03X",GPR_Name(command.rs), else if (command.rt == RSP_REGIMM_BGEZAL && command.rs == 0)
(PC + ((short)command.offset << 2) + 4) & 0xFFC); { /* MIPS pseudo-instruction: BAL (Branch and Link) */
break; sprintf(
case RSP_REGIMM_BGEZAL: CommandName,
if (command.rs == 0) "BAL\t0x%03X",
{ (PC + ((short)command.offset << 2) + 4) & 0xFFC
sprintf(CommandName,"BAL\t0x%03X",(PC + ((short)command.offset << 2) + 4) & 0xFFC); );
} }
else else
{ {
sprintf(CommandName,"BGEZAL\t%s, 0x%03X",GPR_Name(command.rs), sprintf(
(PC + ((short)command.offset << 2) + 4) & 0xFFC); CommandName,
} "%s\t%s, 0x%03X",
break; mnemonics_regimm[command.rt],
default: GPR_Name(command.rs),
sprintf(CommandName,"RSP: Unknown\t%02X %02X %02X %02X", (PC + ((short)command.offset << 2) + 4) & 0xFFC
command.Ascii[3],command.Ascii[2],command.Ascii[1],command.Ascii[0]); );
} }
return CommandName; return CommandName;
} }