1 #include "../Iinstr.hpp"
4 class Cldi : public Iinstr {
9 std::string toString();
13 * Name: create_instruction
14 * Purpose: if compiled as shared library, this functions creates the
17 * Returns: pointer to instruction object
19 extern "C" Iinstr* create_instruction() {
24 * Name: destroy_instruction
25 * Purpose: if compiled as shared library, this functions destoys the
28 * Parameter: IInstruction - the instruction object to delete
30 extern "C" void destroy_instruction(Iinstr* p) {
40 void Cldi::evalInstr()
42 this->m_s = argbits[2];
43 this->m_hl = argbits[1];
46 dynamic_bitset<> immb = argbits;
48 this->m_imm = this->generate16ImmSign(immb.to_ulong());
51 m_rd = this->getRegister(argbits);
54 void Cldi::execInstr()
56 cout << "should exec " << this->toString() << endl;
59 std::string Cldi::toString()
62 op << this->getName();
67 op << this->getConditionFlag() << " r" << m_rd << ", " << m_imm;