CeDOS - apps/fibonacci.c

apps/fibonacci.c (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "assembly.h"

#include <stdint.h>

void fib(void) {
    uint32_t a = 0, b = 1;
    while (1) {
        uint32_t tmp = a + b;
        a = b;
        b = tmp;
        syscall(0, a, 0, 0);
        hlt();
    }
}