diff options
Diffstat (limited to 'c/bigfib/bigfib.c')
| -rw-r--r-- | c/bigfib/bigfib.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/c/bigfib/bigfib.c b/c/bigfib/bigfib.c new file mode 100644 index 0000000..063c27e --- /dev/null +++ b/c/bigfib/bigfib.c @@ -0,0 +1,23 @@ +/* Fibonacci Sequence for RVController + * A product of Advanced Mesecons Devices, a Cheapie Systems company + * This is free and unencumbered software released into the public domain. + * See http://unlicense.org/ for more information */ + +#include <stdint.h> +#include "rvcontroller-ecalls.h" + +uint64_t prev = 0; +uint64_t oldprev = 0; +uint64_t curr = 1; + +void main(void) { + while ((curr & 0x800000000000000) == 0 ) { + printstr("\nH "); + printint(curr/(1LL << 32)); + printstr("\nL "); + printint(curr%(1LL << 32)); + oldprev = prev; + prev = curr; + curr = prev + oldprev; + } +} |
