Play-/Source/MIPSReflection.h
jpd002 0c5fb983fd Moved remotely
git-svn-id: http://svn.purei.org/purei/trunk@40 b36208d7-6611-0410-8bec-b1987f11c4a2
2006-06-15 04:19:30 +00:00

43 lines
1.1 KiB
C++

#ifndef _MIPSREFLECTION_H_
#define _MIPSREFLECTION_H_
#include "Types.h"
class CMIPS;
namespace MIPSReflection
{
struct INSTRUCTION;
struct SUBTABLE
{
uint32 nShift;
uint32 nMask;
INSTRUCTION* pTable;
};
struct INSTRUCTION
{
const char* sMnemonic;
SUBTABLE* pSubTable;
void (*pGetMnemonic)(INSTRUCTION*, CMIPS*, uint32, char*, unsigned int);
void (*pGetOperands)(INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
bool (*pIsBranch)(INSTRUCTION*, CMIPS*, uint32);
uint32 (*pGetEffectiveAddress)(INSTRUCTION*, CMIPS*, uint32, uint32);
};
INSTRUCTION* DereferenceInstruction(SUBTABLE*, uint32);
void CopyMnemonic(INSTRUCTION*, CMIPS*, uint32, char*, unsigned int);
void SubTableMnemonic(INSTRUCTION*, CMIPS*, uint32, char*, unsigned int);
void SubTableOperands(INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
bool IsBranch(INSTRUCTION*, CMIPS*, uint32);
bool SubTableIsBranch(INSTRUCTION*, CMIPS*, uint32);
uint32 SubTableEffAddr(INSTRUCTION*, CMIPS*, uint32, uint32);
};
#endif