void evalInstr();
void execInstr();
std::string toString();
+ Iinstr* getNew();
};
/**
return new Cadd();
}
+Iinstr* Cadd::getNew() {
+ return new Cadd();
+}
+
/**
* Name: destroy_instruction
* Purpose: if compiled as shared library, this functions destoys the
void Cadd::execInstr()
{
- cout << "should exec" << this->toString() << endl;
+ cout << "should exec " << this->toString() << endl;
+ CDat val = this->m_cpu->getRegister(m_ra) + this->m_cpu->getRegister(m_rb);
+ this->m_cpu->setRegister(m_rd, val);
+ this->m_cpu->updateFlags(val);
}
std::string Cadd::toString()