sim: instrs can have different effect on perf count
[calu.git] / 3c_disasm / instr / branch.cpp
index 405acc0854acaa53e6e7581a828390c4b935b519..b8781da5d07ed42c323e2b67da8acbf189b9e01b 100644 (file)
@@ -64,9 +64,11 @@ void Cbranch::evalInstr()
                        break;
                case 2:
                        this->name = "ret";
+                       this->clockcount = 3;
                        break;
                case 3:
                        this->name = "reti";
+                       this->clockcount = 3;
                        break;
                default:
                        cerr << "What have you done? 2 bits that have more than 4 values?!" << endl;
@@ -88,8 +90,8 @@ void Cbranch::execInstr()
                case 1:
                        {
                        CDat sp = this->m_cpu->getStack();
-                       this->m_cpu->setRAM(sp, pc);
                        sp -= 4;
+                       this->m_cpu->setRAM(sp, this->m_cpu->getNextPC());
                        this->m_cpu->setStack(sp);
                        }
                case 0: