disasm/sim: changed interface, branch => br, features++
[calu.git] / 3c_disasm / instr / subi.cpp
index a988f814d9fb69933b0ea4b535686be349f4ebb8..8a90ae825f308b1ebf907ea60a9f40ba9743a028 100644 (file)
@@ -6,6 +6,7 @@ class Csubi : public Iinstr {
                void evalInstr();
                void execInstr();
                std::string toString();
+               Iinstr* getNew();
 };
 
 /**
@@ -19,6 +20,10 @@ extern "C" Iinstr* create_instruction() {
     return new Csubi();
 }
 
+Iinstr* Csubi::getNew() {
+       return new Csubi();
+}
+
 /**
  * Name:      destroy_instruction
  * Purpose:   if compiled as shared library, this functions destoys the 
@@ -57,6 +62,9 @@ void Csubi::evalInstr()
 void Csubi::execInstr()
 {
        cout << "should exec " << this->toString() << endl;
+       CDat reg = this->m_cpu->getRegister(m_ra) - this->m_imm;
+       this->m_cpu->setRegister(m_rd, reg);
+       this->m_cpu->updateFlags(reg);
 }
 
 std::string Csubi::toString()