sim: call pushed current pc instead of next pc onto stack
authorMartin Perner <martin@perner.cc>
Wed, 3 Nov 2010 22:27:04 +0000 (23:27 +0100)
committerMartin Perner <martin@perner.cc>
Wed, 3 Nov 2010 22:27:04 +0000 (23:27 +0100)
3c_disasm/instr/branch.cpp
3c_disasm/instr/branchreg.cpp

index 28ff4ebaee30acec0097030c1b3e95db4be2dfe6..39b2e73c415348fcef9ed366893eb55902f6cd2f 100644 (file)
@@ -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:
index 16a251f630d6070782dc7f5d786a0719f8c47a83..2bd92358c821357573c2c55072945da3b74f0c25 100644 (file)
@@ -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);