uart: swap status with config half word
[calu.git] / 3c_disasm / dasm.cpp
index 08796f1509558df10aea8eae1c4f11b6e56c8e2a..254644106ce3da0cde6287054ba376d7383c5d7b 100644 (file)
@@ -7,6 +7,7 @@
 #include <map>
 #include "disasm.h"
 
+
 #include "CInstrFactory.hpp"
 
 using boost::lexical_cast;
@@ -19,6 +20,10 @@ namespace po = boost::program_options;
 
 std::string progName;
 
+
+CCpu* Iinstr::m_cpu;
+disasm* Iinstr::m_disasm;
+
 int main(int argc, char* argv[])
 {
        progName = argv[0];
@@ -69,18 +74,7 @@ int main(int argc, char* argv[])
 
        CInstrFactory instrFab;
        try {
-#ifdef DEBUG
-               cout << "Loaded " << instrFab.searchLibsInDir(dir) << " Libraryfiles" << endl;
-#else
-               instrFab.searchLibsInDir(dir);
-#endif
-               while(instrFab.getNumFiles() >= 1) {
-                       Iinstr* pinstr = instrFab.getNextInstr();
-                       instr.insert(make_pair(pinstr->getOpcode(),pinstr));
-#ifdef DEBUG
-                       cout << "found: " << instr->getName() << " its opcode is : " << instr->getOpcode() << endl;
-#endif
-               }
+               instrFab.loadLibsIntoMap(instr, dir);
        }
        catch(std::bad_alloc& e) {
                cerr << progName << ": bad_alloc caught " << e.what() << endl;
@@ -131,7 +125,7 @@ int main(int argc, char* argv[])
                                                out << "[0x" << *tok_iter << "]: ";
                                        }
                                        else if(count == 2) {
-                                               out << disasm.decode(*tok_iter);
+                                               out << disasm.decodeToString(*tok_iter);
                                        }
                                        else if(count == 3) {
                                                //code saved in hex-file