1 #include "../Iinstr.hpp"
4 class Candx : public Iinstr {
9 std::string toString();
14 * Name: create_instruction
15 * Purpose: if compiled as shared library, this functions creates the
18 * Returns: pointer to instruction object
20 extern "C" Iinstr* create_instruction() {
24 Iinstr* Candx::getNew()
29 * Name: destroy_instruction
30 * Purpose: if compiled as shared library, this functions destoys the
33 * Parameter: IInstruction - the instruction object to delete
35 extern "C" void destroy_instruction(Iinstr* p) {
45 void Candx::evalInstr()
47 this->m_d = argbits[0];
48 this->m_f = argbits[1];
49 this->m_hl = argbits[2];
52 dynamic_bitset<> immb = argbits;
54 this->m_imm = this->generate16ImmSign(immb.to_ulong());
57 m_rd = this->getRegister(argbits);
60 void Candx::execInstr()
62 CDat val = this->m_cpu->getRegister(this->m_rd);
63 CDat imm = generate16ImmFill(this->m_imm);
66 this->m_cpu->setRegister(this->m_rd, val);
68 this->m_cpu->updateFlags(val);
72 std::string Candx::toString()
75 op << this->getName();
81 op << this->getConditionFlag() << " r" << m_rd << ", " << m_imm;