1 #include "../Iinstr.hpp"
3 class Cxor : public Iinstr {
8 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() {
23 Iinstr* Cxor::getNew() {
28 * Name: destroy_instruction
29 * Purpose: if compiled as shared library, this functions destoys the
32 * Parameter: IInstruction - the instruction object to delete
34 extern "C" void destroy_instruction(Iinstr* p) {
44 void Cxor::evalInstr()
46 this->m_d = argbits[0];
49 m_rb = this->getRegister(argbits);
52 m_ra = this->getRegister(argbits);
55 m_rd = this->getRegister(argbits);
58 void Cxor::execInstr()
60 //cout << "should exec " << this->toString() << endl;
61 CDat ra = this->m_cpu->getRegister(m_ra);
62 CDat rb = this->m_cpu->getRegister(m_rb);
64 this->m_cpu->setRegister(m_rd, val);
66 this->m_cpu->updateFlags(val);
70 std::string Cxor::toString()
73 op << this->getName();
78 op << " r" << m_rd << ", r" << m_ra << ", r" << m_rb;