[sim] bug + display
[calu.git] / 3c_disasm / instr / branch.cpp
index b8781da5d07ed42c323e2b67da8acbf189b9e01b..b79776224726137cac74bc9f1a85791447f0c4c4 100644 (file)
@@ -94,8 +94,9 @@ void Cbranch::execInstr()
                        this->m_cpu->setRAM(sp, this->m_cpu->getNextPC());
                        this->m_cpu->setStack(sp);
                        }
+                       /* fall through */
                case 0:
-                       this->m_cpu->setNextPC(pc+this->m_imm);
+                       this->m_cpu->setNextPC(pc+(this->m_imm*4));
                        break;
                case 2:
                case 3:
@@ -117,7 +118,7 @@ std::string Cbranch::toString()
 
        op << this->getConditionFlag() << (m_taken ? '+' : '-');
        if(m_typ < 2) {
-               op << " 0x" << std::hex << m_imm << "(" << std::dec << m_imm << ")";
+               op << " 0x" << std::hex << m_imm << "(" << std::dec << m_imm << ", " << (int) m_imm << ")";
        }
        return op.str();
 }