Mercurial > lcfOS
comparison user/lib/lib.c3 @ 402:0fb6633c42f6
Moved several files to logical locations
author | Windel Bouwman |
---|---|
date | Thu, 19 Feb 2015 00:13:07 +0100 |
parents | user/lib.c3@6ae782a085e0 |
children | 6aa9743ed362 |
comparison
equal
deleted
inserted
replaced
401:994c00d55fd5 | 402:0fb6633c42f6 |
---|---|
1 module lib; | |
2 import ipc; | |
3 | |
4 /* | |
5 Runtime library. | |
6 */ | |
7 | |
8 // Hack until something better exists: | |
9 function void putc(int c) | |
10 { | |
11 var int *UART0DR; | |
12 UART0DR = cast<int*>(0x109000); // UART0 DR register when remapped at 1MB | |
13 *UART0DR = c; | |
14 } | |
15 | |
16 function void print(string txt) | |
17 { | |
18 // TODO | |
19 var ipc.Msg msg; | |
20 ipc.SendMessage(&msg); | |
21 | |
22 // TBD: send text to putc or via send message?? | |
23 var int i; | |
24 i = 0; | |
25 | |
26 while (i < txt->len) | |
27 { | |
28 putc(cast<int>(txt->txt[i])); | |
29 i = i + 1; | |
30 } | |
31 } | |
32 | |
33 |