if(instr == NULL) {
throw string("Out of Instructions!");
}
+ this->incPerf();
if(this->conditionMet(instr->getCondition())) {
cout << "Executing: " << instr->toString() << endl;
instr->execInstr();
this->m_stack = val;
}
-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_reg(regs), m_ram(ram), m_prog(prog), m_stack(0)
+CDat CCpu::getPerf() const
+{
+ return this->m_perf;
+}
+
+void CCpu::setPerf(CDat val)
+{
+ this->m_perf = val;
+}
+
+void CCpu::incPerf()
+{
+ this->m_perf++;
+}
+
+
+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)
{
}