From b22551b874fe6ef1607e18d686a0c1c1e4a7b9fc Mon Sep 17 00:00:00 2001 From: Martin Perner Date: Wed, 3 Nov 2010 23:27:04 +0100 Subject: [PATCH] sim: call pushed current pc instead of next pc onto stack --- 3c_disasm/instr/branch.cpp | 2 +- 3c_disasm/instr/branchreg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3c_disasm/instr/branch.cpp b/3c_disasm/instr/branch.cpp index 28ff4eb..39b2e73 100644 --- a/3c_disasm/instr/branch.cpp +++ b/3c_disasm/instr/branch.cpp @@ -89,7 +89,7 @@ void Cbranch::execInstr() { CDat sp = this->m_cpu->getStack(); sp -= 4; - this->m_cpu->setRAM(sp, pc); + this->m_cpu->setRAM(sp, this->m_cpu->getNextPC()); this->m_cpu->setStack(sp); } case 0: diff --git a/3c_disasm/instr/branchreg.cpp b/3c_disasm/instr/branchreg.cpp index 16a251f..2bd9235 100644 --- a/3c_disasm/instr/branchreg.cpp +++ b/3c_disasm/instr/branchreg.cpp @@ -75,7 +75,7 @@ void Cbranchreg::execInstr() if(this->m_typ == 1) { CDat sp = this->m_cpu->getStack(); sp -= 4; - this->m_cpu->setRAM(sp, this->m_cpu->getCurPC()); + this->m_cpu->setRAM(sp, this->m_cpu->getNextPC()); this->m_cpu->setStack(sp); } this->m_cpu->setNextPC(pc); -- 2.25.1