if(instr == NULL) {
throw string("Out of Instructions!");
}
- this->incPerf();
if(this->conditionMet(instr->getCondition())) {
cout << "Executing: " << instr->toString() << endl;
instr->execInstr();
+ this->incPerfBy(instr->getClockCount());
}
else {
cout << "Didn't Execute " << instr->toString() << "; condition wasn't met" << endl;
+ this->incPerf();
}
}
this->m_perf++;
}
+void CCpu::incPerfBy(short inc)
+{
+ this->m_perf += inc;
+}
+
CCpu::CCpu(int regs, int ram, int prog) : m_Z(false), m_S(false), m_C(false), m_O(false), m_pc(0), m_pc_next(0), m_perf(0), m_reg(regs), m_ram(ram), m_prog(prog), m_stack(0)
{