2006-06-15 04:19:30 +00:00
|
|
|
#ifndef _MIPSREFLECTION_H_
|
|
|
|
#define _MIPSREFLECTION_H_
|
|
|
|
|
|
|
|
#include "Types.h"
|
2011-12-10 20:49:50 +00:00
|
|
|
#include "MIPSArchitecture.h"
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
class CMIPS;
|
|
|
|
|
|
|
|
namespace MIPSReflection
|
|
|
|
{
|
|
|
|
struct INSTRUCTION;
|
|
|
|
|
|
|
|
struct SUBTABLE
|
|
|
|
{
|
|
|
|
uint32 nShift;
|
|
|
|
uint32 nMask;
|
|
|
|
INSTRUCTION* pTable;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct INSTRUCTION
|
|
|
|
{
|
2011-12-10 20:49:50 +00:00
|
|
|
const char* sMnemonic;
|
|
|
|
SUBTABLE* pSubTable;
|
|
|
|
void (*pGetMnemonic)(INSTRUCTION*, CMIPS*, uint32, char*, unsigned int);
|
|
|
|
void (*pGetOperands)(INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
MIPS_BRANCH_TYPE (*pIsBranch)(INSTRUCTION*, CMIPS*, uint32);
|
|
|
|
uint32 (*pGetEffectiveAddress)(INSTRUCTION*, CMIPS*, uint32, uint32);
|
2006-06-15 04:19:30 +00:00
|
|
|
};
|
|
|
|
|
2011-12-10 20:49:50 +00:00
|
|
|
INSTRUCTION* DereferenceInstruction(SUBTABLE*, uint32);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2011-12-10 20:49:50 +00:00
|
|
|
void CopyMnemonic(INSTRUCTION*, CMIPS*, uint32, char*, unsigned int);
|
|
|
|
void SubTableMnemonic(INSTRUCTION*, CMIPS*, uint32, char*, unsigned int);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2011-12-10 20:49:50 +00:00
|
|
|
void SubTableOperands(INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2011-12-10 20:49:50 +00:00
|
|
|
MIPS_BRANCH_TYPE IsBranch(INSTRUCTION*, CMIPS*, uint32);
|
|
|
|
MIPS_BRANCH_TYPE IsNoDelayBranch(INSTRUCTION*, CMIPS*, uint32);
|
|
|
|
MIPS_BRANCH_TYPE SubTableIsBranch(INSTRUCTION*, CMIPS*, uint32);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2011-12-10 20:49:50 +00:00
|
|
|
uint32 SubTableEffAddr(INSTRUCTION*, CMIPS*, uint32, uint32);
|
2006-06-15 04:19:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|