#include <param.h>
Inheritance diagram for Param:
Public Types | |
typedef enum Param::MemoryTypes | MemoryTypes |
enum | TCRegistry { Registry } |
enum | TCLiteral { Literal } |
enum | TCFarLiteral { FarLiteral } |
enum | TCMemory { Memory } |
enum | Types { t_registry, t_literal, t_memory, t_farliteral } |
enum | MemoryTypes { name, name, memNone, memInt8, memMmx, memMmx8, memXmm, memFarPointer16, memBound16, memDescriptor, memFPFloat32, memFPBCD, memFPEnv16, memFPStatus16, memXStatus, memTypeCount } |
Public Methods | |
enum Types | GetType () const |
Param () | |
Param (enum TCRegistry dummy, reg_t reg) | |
Param (enum TCLiteral dummy, int _literal, unsigned char _size=0) | |
Param (enum TCFarLiteral dummy, int _literal, unsigned char _size, int segment) | |
Param (enum TCMemory dummy, int address, MemoryTypes memType=memNone) | |
Param (enum TCMemory dummy, reg_t reg, int address=0, MemoryTypes memType=memNone) | |
Param (enum TCMemory dummy, reg_t reg1, reg_t reg2, int address=0, unsigned char multiplier=1, MemoryTypes memType=memNone) | |
bool | RegEqual (const Param &rhs) const |
unsigned char | GetSize () const |
unsigned char | GetLiteralSize () const |
unsigned | GetMemSize () const |
void | SetMemType (MemoryTypes _memType, bool bWriteSize=true) |
bool | MustWriteMemSize () const |
Public Attributes | |
reg_t | mem_reg1 |
reg_t | mem_reg2 |
int | literal |
const Relocation * | relocation |
enum Types | type |
unsigned char | factor |
Private Attributes | |
union { | |
unsigned char size | |
unsigned char memType | |
} | sm |
Static Private Attributes | |
unsigned | memTypeSizes [memTypeCount] |
|
Referenced by InstructionDecoder::do_mod_rm(), InstructionDecoder::mod_reg2(), and RegSizeToMemType(). |
|
Definition at line 47 of file param.h.
00047 { 00048 #define DEFINE_MEMTYPE(name,size) name, 00049 #define DEFINE_MEMTYPEI(name,size) name = 0, 00050 #include "memtype.h" 00051 #undef DEFINE_MEMTYPE 00052 #undef DEFINE_MEMTYPEI 00053 memTypeCount 00054 } MemoryTypes; 00055 // std::string GetString() const; 00056 enum Types GetType() const { return type; }; 00057 Param():relocation(NULL) {}; 00058 // costruttori per registro 00059 Param(enum TCRegistry dummy,reg_t reg); 00060 // costruttori per letterali (costanti) 00061 Param(enum TCLiteral dummy,int _literal,unsigned char _size=0); 00062 // costruttori per letterali (costanti) 00063 Param(enum TCFarLiteral dummy,int _literal,unsigned char _size,int segment); 00064 // costruttori per memoria 00065 Param(enum TCMemory dummy,int address,MemoryTypes memType = memNone); 00066 Param(enum TCMemory dummy,reg_t reg,int address=0,MemoryTypes memType = memNone); 00067 Param(enum TCMemory dummy,reg_t reg1,reg_t reg2,int address=0,unsigned char multiplier=1,MemoryTypes memType = memNone); 00068 00069 //protected: 00070 public: 00071 bool RegEqual(const Param& rhs) const 00072 { return type == t_registry && rhs.type == t_registry && mem_reg1 == rhs.mem_reg1; } 00073 // bool operator==(); 00074 reg_t mem_reg1; // null_reg if not present, set if type registry 00075 reg_t mem_reg2; // null_reg if not present 00076 int literal; // 0 if not present 00077 const Relocation* relocation; // informazioni rilocazione relative a literal 00078 enum Types type; 00079 unsigned char factor; // if mem_reg2 set 00080 unsigned char GetSize() const; 00081 unsigned char GetLiteralSize() const 00082 { 00083 _PRG_ASSERT( type == t_literal || type == t_farliteral ); 00084 return sm.size; 00085 }; 00086 unsigned GetMemSize() const 00087 { 00088 _PRG_ASSERT( type == t_memory ); 00089 _PRG_ASSERT( unsigned(sm.memType&0x7F) < memTypeCount ); 00090 return memTypeSizes[sm.memType&0x7F]; 00091 }; 00092 void SetMemType(MemoryTypes _memType,bool bWriteSize = true) 00093 { 00094 _PRG_ASSERT( type == t_memory ); 00095 _PRG_ASSERT( unsigned(_memType) < memTypeCount ); 00096 _PRG_ASSERT( memTypeCount < 128 ); 00097 sm.memType = (unsigned char)_memType; 00098 if (!bWriteSize) 00099 sm.memType |= 0x80; 00100 }; 00101 bool MustWriteMemSize() const 00102 { 00103 _PRG_ASSERT( type == t_memory ); 00104 return (sm.memType & 0x80) == 0; 00105 } 00106 private: 00107 union { 00108 unsigned char size; // 0 if unspecified 00109 unsigned char memType; 00110 } sm; 00111 static unsigned memTypeSizes[memTypeCount]; 00112 }; 00113 00114 class RegParam: public Param 00115 { 00116 public: 00117 RegParam(reg_t reg); |
|
Definition at line 44 of file param.h.
00044 { FarLiteral }; |
|
Definition at line 43 of file param.h.
00043 { Literal }; |
|
Definition at line 45 of file param.h.
00045 { Memory }; |
|
Definition at line 42 of file param.h.
00042 { Registry }; |
|
Definition at line 46 of file param.h.
00046 { t_registry, t_literal, t_memory, t_farliteral }; |
|
Definition at line 120 of file param.h. References LiteralParam::LiteralParam().
00120 : public Param |
|
Definition at line 107 of file param.cpp. References sm.
00107 { 00108 sm.size = 0; 00109 } 00110 00111 void Param::CheckValid() 00112 { 00113 if (type == t_literal) 00114 { 00115 _PRG_ASSERT(sm.size != 0); |
|
Definition at line 117 of file param.cpp.
00121 { 00122 switch (type) 00123 { 00124 default: 00125 _PRG_ASSERT(0); |
|
Definition at line 127 of file param.cpp. References mem_reg1, t_farliteral, t_literal, and t_registry.
00128 : 00129 case t_farliteral: 00130 return GetLiteralSize(); 00131 case t_registry: 00132 return RegistryInfo::GetInfo(mem_reg1)->GetByteSize(); 00133 } 00134 } |
|
|
|
|
|
|
|
Definition at line 144 of file param.h. Referenced by CodeParser::CheckForAddress(), CodeParser::CheckImmediateCodeAddress(), and Instruction::Write(). |
|
Definition at line 149 of file param.h. Referenced by CodeParser::CheckForAddress(), InstructionDecoder::Decode(), CodeParser::ExecuteComplexReferenceMemory(), Instruction::GetUseType(), and Instruction::Write(). |
|
|
|
Definition at line 119 of file param.h. Referenced by THeuristicMotor::THeuristicMotor().
00120 : public Param |
|
Definition at line 164 of file param.h. Referenced by Instruction::Write(). |
|
Definition at line 134 of file param.h. Referenced by Instruction::WriteRegUsage(). |
|
Definition at line 155 of file param.h. Referenced by InstructionDecoder::do_mod_rm(). |
|
Definition at line 142 of file param.h. Referenced by InstructionDecoder::do_mod_rm(), InstructionDecoder::do_sib(), CodeParser::ExecuteComplexReferenceMemory(), InstructionDecoder::mod0(), InstructionDecoder::mod1(), InstructionDecoder::mod2(), Instruction::Write(), and Instruction::WriteRegUsage(). |
|
Definition at line 139 of file param.h. Referenced by CodeParser::AddTempFlow(), CodeParser::CheckForAddress(), CodeParser::CheckImmediateCodeAddress(), CodeParser::CheckJumpReference(), CodeParser::ContainValidAddress(), CodeParser::ExecuteComplexReferenceMemory(), InstructionDecoder::getv_rel(), CodeParser::IsApiReference(), ScanningComplexReg::ProcessInstruction(), CodeParser::ScanCode(), THeuristicMotor::THeuristicMotor(), Instruction::Write(), and Instruction::WriteRegUsage(). |
|
Definition at line 137 of file param.h. Referenced by CodeParser::AddTempFlow(), CodeParser::CheckForAddress(), CodeParser::CheckJumpReference(), CodeParser::ExecuteComplexReferenceMemory(), CodeParser::ExecuteComplexReferenceReg(), Instruction::GetUseType(), CodeParser::IsApiReference(), Param(), THeuristicMotor::THeuristicMotor(), Instruction::Write(), and Instruction::WriteRegUsage(). |
|
Definition at line 138 of file param.h. Referenced by CodeParser::AddTempFlow(), CodeParser::CheckForAddress(), CodeParser::CheckJumpReference(), InstructionDecoder::do_mod_rm(), InstructionDecoder::do_sib(), CodeParser::ExecuteComplexReferenceMemory(), Instruction::GetUseType(), CodeParser::IsApiReference(), InstructionDecoder::mod0(), InstructionDecoder::mod1(), InstructionDecoder::mod2(), THeuristicMotor::THeuristicMotor(), Instruction::Write(), and Instruction::WriteRegUsage(). |
|
|
|
|
|
Definition at line 140 of file param.h. Referenced by CodeParser::ContainValidAddress(), InstructionDecoder::Decode(), and InstructionDecoder::getv_rel(). |
|
|
|
Referenced by Param(). |
|