sim: labels and comments are now shown
[calu.git] / 3c_disasm / disasm.cpp
index 0c6c5f09119e6dde572aa5e20ec2cf3f831b3f73..0cb75facc2420342e0d02e9f8d197aceb7da389f 100644 (file)
@@ -10,8 +10,13 @@ Iinstr* disasm::decode(std::string str)
        string hex = "0x";
        hex.append(str);
 
-       unsigned int val =  lexical_cast<uint32_from_hex>(hex);
+       CDat val =  lexical_cast<uint32_from_hex>(hex);
+       return this->decodeNum(val);
+}
+
 
+Iinstr* disasm::decodeNum(CDat val)
+{
        dynamic_bitset<> bits(32,val), opcode(32,val), condition(9), args(32);
 
        args = opcode;
@@ -52,7 +57,7 @@ Iinstr* disasm::decodeOpcode(short opcode)
        }
        else {
                stringstream err;
-               err << "opcode not found" << endl;
+               err << "opcode not found. in was " << opcode  << endl;
                throw err.str();
        }
 }