aboutsummaryrefslogtreecommitdiff
path: root/fibonacci.py
diff options
context:
space:
mode:
authorBenedict <benedict@0xb8000.de>2018-04-26 11:16:20 +0200
committerBenedict <benedict@0xb8000.de>2018-04-26 12:36:14 +0200
commitc53152068bd043d503b69d3f64a09ac592008e07 (patch)
treed99392bf4bc21ca6fa4f868bba31ff545977d505 /fibonacci.py
parenta34ee32c743b35170777038a4c3ebbabf5686b43 (diff)
pi: added programm which computes the fibonacci sequence
Diffstat (limited to 'fibonacci.py')
-rw-r--r--fibonacci.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/fibonacci.py b/fibonacci.py
new file mode 100644
index 0000000..d01139d
--- /dev/null
+++ b/fibonacci.py
@@ -0,0 +1,10 @@
+import inst
+
+## this programm computes the fibonacci sequence
+
+## load the start values 1 and 1 into the two registers
+## add the content of the two registers and save it alternating into the two
+## registers, an repeat
+prog = [inst.INST_LDA | 0x1, inst.INST_LDB | 0x1, inst.INST_REG_A_OUT,
+ inst.INST_ADD_A, inst.INST_REG_A_OUT, inst.INST_ADD_B,
+ inst.INST_REG_B_OUT, inst.INST_PC_LOAD | 0x3]