diff kernel/src/io.c3 @ 360:42343d189e14

Bugfix in for loop
author Windel Bouwman
date Fri, 14 Mar 2014 16:11:32 +0100
parents b4ac28efcdf4
children
line wrap: on
line diff
--- a/kernel/src/io.c3	Fri Mar 14 15:41:55 2014 +0100
+++ b/kernel/src/io.c3	Fri Mar 14 16:11:32 2014 +0100
@@ -27,15 +27,10 @@
     // int txt[20];
     var int b;
     var int c;
-    var int d;
-    d = 12;
 
-    for (b = 28; b > 0; b = b - 4)
+    for (b=28; b >= 0; b = b - 4)
     {
-        //c = 7; // (i >> b) & 0xF;
-        d = b;
-        c = (i >> d) & 0xF;
-        // c = (i >> b) & 0xF;
+        c = (i >> b) & 0xF;
         if (c < 10)
         {
             arch.putc( 48 + c );
@@ -44,10 +39,14 @@
         {
             arch.putc( 65 - 10 + c );
         }
-        // arch.putc( 65 );
-
     }
 
-    println("");
+    arch.putc(10); // Newline!
 }
 
+function void print2(string label, int value)
+{
+    print(label);
+    print_int(value);
+}
+