annotate kernel/io.c3 @ 355:c2ddc8a36f5e

Enabled optimization
author Windel Bouwman
date Fri, 14 Mar 2014 10:30:13 +0100
parents
children 52492b304adf
rev   line source
355
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
1 module io;
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
2 import arch;
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
3
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
4 function void print(string txt)
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
5 {
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
6 var int i;
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
7 i = 0;
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
8
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
9 while (i < txt->len)
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
10 {
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
11 arch.putc(cast<int>(txt->txt[i]));
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
12 i = i + 1;
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
13 }
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
14 }
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
15
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
16 function void print_int(int i)
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
17 {
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
18 // int txt[20];
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
19 while (i != 0)
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
20 {
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
21 arch.putc(1);
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
22 }
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
23 }
c2ddc8a36f5e Enabled optimization
Windel Bouwman
parents:
diff changeset
24