]> git.sur5r.net Git - cc65/commitdiff
added deb.c (simple program to enter the debugger)
authorcpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 25 Jun 2000 02:20:13 +0000 (02:20 +0000)
committercpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 25 Jun 2000 02:20:13 +0000 (02:20 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@127 b7a2c559-68d2-44c3-8de9-860c34a00d81

testcode/lib/deb.c [new file with mode: 0644]

diff --git a/testcode/lib/deb.c b/testcode/lib/deb.c
new file mode 100644 (file)
index 0000000..b054fc1
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * test program for the debugger
+ *
+ * press 'd' to enter the debugger
+ *
+ */
+
+#include <stdio.h>
+#include <conio.h>
+#include <6502.h>
+#include <dbg.h>
+
+int main(void)
+{
+  char c;
+
+  /* Initialize the debugger */
+  DbgInit (0);
+
+  clrscr();
+  cputsxy(4,10,"Debugger test...."); cgetc();
+  while(1) {
+    printf("press d to debug, q to exit....\n");
+    c = cgetc();
+    if (c == 'q') {
+      printf("exiting....\n");
+      return(0);
+    }
+    if (c == 'd') {
+      printf("entering debug...\n");
+      BREAK();
+      printf("return from debug...\n");
+    }
+    else {
+      printf("unknown key '%c'\n",c);
+    }
+  }
+}