view hello.cbc @ 0:e16c397c8845

add memo and change hello.cbc file.
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Thu, 26 Apr 2012 16:45:40 +0900
parents
children e8992ca15539
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>

__code loop_end(void)
{
    exit(0);
}

__code loop_print(int count)
{
    printf("helloWorld\n");
    goto loop0(count);
}

__code loop0(int count)
{
    if (count <= 10) {
        printf("count :%d\n", count);
        goto loop_print(count+1);
    } else {
        goto loop_end();
    }
}

int main (void)
{
    int count = 0;
    goto loop0(count);
    return 0;
}