view user/lib/lib.c3 @ 410:6aa9743ed362 tip

Reflect change in c3 public modifier
author Windel Bouwman
date Mon, 23 Feb 2015 21:06:04 +0100
parents 0fb6633c42f6
children
line wrap: on
line source

module lib;
import ipc;

/*
Runtime library.
*/

// Hack until something better exists:
function void putc(int c)
{
    var int *UART0DR;
    UART0DR = cast<int*>(0x109000); // UART0 DR register when remapped at 1MB
    *UART0DR = c;
}

public function void print(string txt)
{
    // TODO
    var ipc.Msg msg;
    ipc.SendMessage(&msg);

    // TBD: send text to putc or via send message??
    var int i;
    i = 0;

    while (i < txt->len)
    {
        putc(cast<int>(txt->txt[i]));
        i = i + 1;
    }
}