+#ifndef __IINSTR_I_
+#define __IINSTR_I_
+
#include <string>
#include <boost/dynamic_bitset.hpp>
#include <iostream>
#include <sstream>
-#ifndef __IINSTR_I_
-#define __IINSTR_I_
+class CCpu;
+
+#include "ccpu.hpp"
+
/* concept from https://groups.google.com/group/comp.arch.embedded/msg/9d430b6d3da12c8f */
#define to_HEX__(x) 0x##x##LU
+((x & 0xF0000UL) ? 16 : 0)
#define B5(x) ((unsigned char)to_B5__(to_HEX__(x)))
+/* end concept */
using namespace std;
using namespace boost;
return bits.to_ulong();
}
+ static CCpu* m_cpu;
+
public:
+
+ static void setCPU(CCpu* cpu) { m_cpu = cpu; }
+
virtual ~Iinstr() {}
virtual short getOpcode() { return this->opcode; }
virtual std::string getName() { return this->name; }
virtual void evalInstr() = 0;
virtual void execInstr() = 0;
virtual std::string toString() = 0;
+ virtual Iinstr* getNew() = 0;
+
+ short getCondition() {
+ return m_cond;
+ }
void decodeCondition(short condition) {
if(condition >= 0 && condition <= 15) {
}
protected:
+
std::string getConditionFlag()
{
stringstream cond;
return cond.str();
}
};
+
#endif