summaryrefslogtreecommitdiff
path: root/c/bigfib/bigfib.c
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2026-05-23 20:14:34 -0500
committercheapie <no-email-for-you@example.com>2026-05-23 20:14:34 -0500
commit85b5fde272be6ab543aa866baebabddc24566bdb (patch)
treeb4f2e3bb634effe51c2bdc5585ca4ea8b98d6dfa /c/bigfib/bigfib.c
downloadrvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar.gz
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar.bz2
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.tar.xz
rvcontroller-85b5fde272be6ab543aa866baebabddc24566bdb.zip
Add initial content
Diffstat (limited to 'c/bigfib/bigfib.c')
-rw-r--r--c/bigfib/bigfib.c23
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;
+ }
+}