1 #include "../Iinstr.hpp"
3 class Ccmp : 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* Ccmp::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 Ccmp::evalInstr()
47 m_rb = this->getRegister(argbits);
50 m_ra = this->getRegister(argbits);
53 void Ccmp::execInstr()
55 //cout << "should exec " << this->toString() << endl;
56 CDat ra = this->m_cpu->getRegister(m_ra);
57 CDat rb = this->m_cpu->getRegister(m_rb);
59 this->m_cpu->updateFlags(val, ra, (~rb)+1);
62 std::string Ccmp::toString()
65 op << this->getName();
66 op << " r" << m_ra << ", r" << m_rb;