Mercurial > lcfOS
comparison 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 |
comparison
equal
deleted
inserted
replaced
359:b4ac28efcdf4 | 360:42343d189e14 |
---|---|
25 print("0x"); | 25 print("0x"); |
26 | 26 |
27 // int txt[20]; | 27 // int txt[20]; |
28 var int b; | 28 var int b; |
29 var int c; | 29 var int c; |
30 var int d; | |
31 d = 12; | |
32 | 30 |
33 for (b = 28; b > 0; b = b - 4) | 31 for (b=28; b >= 0; b = b - 4) |
34 { | 32 { |
35 //c = 7; // (i >> b) & 0xF; | 33 c = (i >> b) & 0xF; |
36 d = b; | |
37 c = (i >> d) & 0xF; | |
38 // c = (i >> b) & 0xF; | |
39 if (c < 10) | 34 if (c < 10) |
40 { | 35 { |
41 arch.putc( 48 + c ); | 36 arch.putc( 48 + c ); |
42 } | 37 } |
43 else | 38 else |
44 { | 39 { |
45 arch.putc( 65 - 10 + c ); | 40 arch.putc( 65 - 10 + c ); |
46 } | 41 } |
47 // arch.putc( 65 ); | |
48 | |
49 } | 42 } |
50 | 43 |
51 println(""); | 44 arch.putc(10); // Newline! |
52 } | 45 } |
53 | 46 |
47 function void print2(string label, int value) | |
48 { | |
49 print(label); | |
50 print_int(value); | |
51 } | |
52 |