sim: arith. fixes, optimized mem access
[calu.git] / 3b_sim / sim.cpp
index bd7f5d0f48edbc341835885e7d3f0b5a759289af..4fe52b06f5091ed974b4c88e7b0ae3040e0b3fda 100644 (file)
@@ -302,6 +302,7 @@ void printStatus(const vector<string>&)
        CDat stackd = global_cpu->getRAM(stackp);
        cout << "Stack pointer: " << stackp << " @stackpointer: " << stackd << endl;
        cout << "PSW: 0x" << std::hex << setw(8) << setfill('0') << global_cpu->getFlags() << std::dec << endl;
+       cout << "cur PC: 0x" << std::hex << setw(8) << setfill('0') << global_cpu->getCurPC() << " next PC: 0x" << setw(8) << setfill('0') << global_cpu->getNextPC() << std::dec << endl;
 
 }
 
@@ -445,6 +446,7 @@ int main(int argc, char* argv[])
                                case 2:
                                case 3:
                                        cerr << "ignoring labels and comments for now" << endl;
+                                       break;
                                default:
                                        cerr << "i was to lazy to implement the other format types for now" << endl;
                        }
@@ -494,9 +496,9 @@ int main(int argc, char* argv[])
        Completers.push_back(CompleterElement("quit", &doExit, "Exits program"));
        Completers.push_back(CompleterElement("exit", &doExit, "Exits program"));
        Completers.push_back(CompleterElement("step [count]",&execStep, "Runs [count] ticks. if count is not given one tick is executed."));
-       Completers.push_back(CompleterElement("dre [s] [e]",&printReg, "Prints registers. if s is given, only register s is printed. if s and e are given the registers from s to e are printed. if omitted all registers a printed."));
-       Completers.push_back(CompleterElement("dra [s] [e]",&printRAM, "Prints RAM. if s is given, only RAM-Addr. s is printed. if s and e are given the RAM-Addrs from s to e are printed. if omitted the first 16 RAM-Addrs are printed."));
-       Completers.push_back(CompleterElement("dpr [s] [e]",&printPROG, "Prints program. if s is given, only Prog-Addr. s is printed. if s and e are given the Prog-Addrs from s to e are printed. if omitted the first 16 Prog-Addrs are printed."));
+       Completers.push_back(CompleterElement("dreg [s] [e]",&printReg, "Prints registers. if s is given, only register s is printed. if s and e are given the registers from s to e are printed. if omitted all registers a printed."));
+       Completers.push_back(CompleterElement("ddata [s] [e]",&printRAM, "Prints RAM. if s is given, only RAM-Addr. s is printed. if s and e are given the RAM-Addrs from s to e are printed. if omitted the first 16 RAM-Addrs are printed."));
+       Completers.push_back(CompleterElement("dprog [s] [e]",&printPROG, "Prints program. if s is given, only Prog-Addr. s is printed. if s and e are given the Prog-Addrs from s to e are printed. if omitted the first 16 Prog-Addrs are printed."));
        Completers.push_back(CompleterElement("break addr",&setBreak, "Sets a breakpoint for address addr."));
        Completers.push_back(CompleterElement("run",&execRun, "Runs till next breakpoint or end of program."));
        Completers.push_back(CompleterElement("setpc [num]",&setPC, "Sets PC to num. if num is omitted 0 is used."));