better shell loop
[dcpu16] / dcpu16.c
index cfa6d8a2b02e2faa3f11e144db8528b0338a8d5b..2a59d24e1cca31f5e161163fc8578d14fdcdc968 100644 (file)
--- a/dcpu16.c
+++ b/dcpu16.c
@@ -25,6 +25,8 @@
  *  TODO
  *    drop checks for assigning to literals -- it won't affect anything anyhow
  *    debug short literal decoding
+ *    add callbacks queues for set/get, attach your own filters
+ *      such as a display
  */
 
 static const char * const src_id_ = "$Id$";
@@ -312,7 +314,7 @@ OP_IMPL(add) {
     if (val_a < 0x1f) {
         *a = acc;
     }
-    d->o = acc >> 16;
+    d->o = (acc > 0xffff);
 
     d->cycle += 2;
 }
@@ -324,9 +326,9 @@ OP_IMPL(sub) {
 
     if (val_a < 0x1f) {
         *a = acc;
-    }
-    d->o = acc >> 16;
+    d->o = (acc > 0xffff);
 
+    }
     d->cycle += 2;
 }