uart: swap status with config half word
[calu.git] / 3b_sim / sim.cpp
index 4896f0120b57ecb591ffdaab07bfddb788f3b3df..d628d10a1cff46ec1cd740a4a1bb0081eb037839 100644 (file)
@@ -20,8 +20,8 @@
 #include "SReadline/SReadline.h"
 using namespace swift;
 
-#define RAM_END (1000)
-#define PROG_END (1000)
+#define RAM_END (0x3000)
+#define PROG_END (0x3000)
 #define REG_COUNT (16)
 
 typedef boost::function<void (const vector<string> &)> Func;
@@ -76,9 +76,11 @@ vector<CDat> breakpoints;
 
 bool ignoreBreak = false;
 
+bool exitProg = false;
+
 void doExit(const vector<string>&)
 {
-       exit(EXIT_SUCCESS);
+       exitProg = true;
 }
 
 unsigned int convertStringToNum(const std::string& in)
@@ -584,13 +586,13 @@ int main(int argc, char* argv[])
                cout << i << " : " << std::hex << i << std::dec << " " << data << endl;
        }
 */
-       cpu.setRegister(1, 4);
+/*     cpu.setRegister(1, 4);
        cpu.setRegister(2, 0);
        cpu.setRAM(0,5);
        cpu.setRAM(4,0x66334455);
        cpu.setRAM(8,32);
        cpu.setRAM(12,45);
-
+*/
        // following: job of the bootloader
        //set stackpointer
        cpu.setStack(500);
@@ -632,7 +634,7 @@ int main(int argc, char* argv[])
        Func lastFunc = NULL;
 
 
-       while(1) {
+       while(!exitProg) {
                UserInput = Reader.GetLine("> ", Tokens, EndOfInput);
                if(EndOfInput) {
                        break;