aboutsummaryrefslogtreecommitdiff
path: root/examples/ique_fibonacci.asm
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-11-25 18:20:15 +0000
committerDimitri Sokolyuk <demon@dim13.org>2015-11-25 18:20:15 +0000
commit76369877147e77c24e6b56f4a166922959c2f149 (patch)
tree4baf650be4971f0577c4a363629099aeddb5a462 /examples/ique_fibonacci.asm
parent4592509f18e44d6302fe3fd7ad69974beb00b749 (diff)
Add examples
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