aboutsummaryrefslogtreecommitdiff
path: root/examples/ique_fibonacci.asm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ique_fibonacci.asm')
-rw-r--r--examples/ique_fibonacci.asm12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/ique_fibonacci.asm b/examples/ique_fibonacci.asm
new file mode 100644
index 0000000..a7f13e4
--- /dev/null
+++ b/examples/ique_fibonacci.asm
@@ -0,0 +1,12 @@
+; http://www.reddit.com/r/dcpu_16_programming/comments/rtvnp/i_wrote_a_program_that_fills_up_the_memory_with/
+
+SET A, 1
+SET B, 1
+SET PEEK, 1
+:loop ADD A, B ; A is now 2, B is still 1
+SET PUSH, A
+SET A, B
+SET B, PEEK
+IFG SP, 10 ; 10 because that's how much space
+ ; this program takes
+SET PC, loop \ No newline at end of file