summaryrefslogtreecommitdiff
path: root/mem/mem.hex
diff options
context:
space:
mode:
authorJulian Blake Kongslie2021-03-30 10:57:47 -0700
committerJulian Blake Kongslie2021-03-30 10:57:47 -0700
commit4f7d94319efbbe12bbbe808f8071731738268957 (patch)
tree9004c5198ddb6fc9171a609d0bfe2d0d76892576 /mem/mem.hex
parentAdd a Fibonacci sequence to the end of output (no ASCII conversion yet) (diff)
downloadnoncpu-4f7d94319efbbe12bbbe808f8071731738268957.tar.xz
Streamlined the Fibonacci program somewhat.
Diffstat (limited to '')
-rw-r--r--mem/mem.hex27
1 files changed, 10 insertions, 17 deletions
diff --git a/mem/mem.hex b/mem/mem.hex
index 3979364..63038e3 100644
--- a/mem/mem.hex
+++ b/mem/mem.hex
@@ -1,28 +1,21 @@
1@0 1@0
2 2
3040 // acc= 0x40
4f20 // idx
5000 // loop: acc= 0 3000 // loop: acc= 0
6100 // load 4140 // load 0x40
7300 // ifeq 0 5300 // ifeq 0
8402 // jmp fib 6402 // jmp fib
9f44 // ++idx tx 7f44 // ++idx tx
104fa // jmp loop 84fa // jmp loop
11040 // fib: acc= 0x40 9f20 // fib: idx
12f20 // idx 10240 // store 0x40
13000 // acc= 0
14200 // store
15f04 // ++idx
16001 // acc= 1 11001 // acc= 1
17200 // store 12241 // store 0x41
18f08 // fibloop: --idx 13000 // fibloop: acc= 0
19000 // acc= 0 14140 // load 0x40
20100 // load 15f44 // tx ++idx
21f44 // ++idx tx 16140 // load 0x40
22100 // load 17241 // store 0x41
23f04 // ++idx 184fa // jmp fibloop
24200 // store
254f8 // jmp fibloop
26 19
27@40 20@40
28 21