1 #include "../Iinstr.hpp"
3 class Cadd : public Iinstr {
8 std::string toString();
12 * Name: create_instruction
13 * Purpose: if compiled as shared library, this functions creates the
16 * Returns: pointer to instruction object
18 extern "C" Iinstr* create_instruction() {
23 * Name: destroy_instruction
24 * Purpose: if compiled as shared library, this functions destoys the
27 * Parameter: IInstruction - the instruction object to delete
29 extern "C" void destroy_instruction(Iinstr* p) {
39 void Cadd::evalInstr()
41 this->m_d = argbits[0];
42 this->m_c = argbits[1];
45 m_rb = this->getRegister(argbits);
48 m_ra = this->getRegister(argbits);
51 m_rd = this->getRegister(argbits);
54 void Cadd::execInstr()
56 cout << "should exec" << this->toString() << endl;
59 std::string Cadd::toString()
62 op << this->getName();
67 op << " r" << m_rd << ", r" << m_ra << ", r" << m_rb;