[sim] corrected address calc for branch, again
authorMartin Perner <martin@perner.cc>
Fri, 17 Dec 2010 23:48:39 +0000 (00:48 +0100)
committerMartin Perner <martin@perner.cc>
Fri, 17 Dec 2010 23:48:39 +0000 (00:48 +0100)
3c_disasm/instr/branch.cpp

index b79776224726137cac74bc9f1a85791447f0c4c4..f1f9138cbfffb875d1f02aa9cb1d5db45342b8e5 100644 (file)
@@ -78,7 +78,7 @@ void Cbranch::evalInstr()
 
        dynamic_bitset<> immb = argbits;
        immb.resize(16);
-       this->m_imm = this->generate16ImmSign(immb.to_ulong());
+       this->m_imm = this->generate16ImmSign(immb.to_ulong())*4;
 
 }
 
@@ -96,7 +96,7 @@ void Cbranch::execInstr()
                        }
                        /* fall through */
                case 0:
-                       this->m_cpu->setNextPC(pc+(this->m_imm*4));
+                       this->m_cpu->setNextPC(pc+(this->m_imm));
                        break;
                case 2:
                case 3: