From 4f7d94319efbbe12bbbe808f8071731738268957 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Tue, 30 Mar 2021 10:57:47 -0700 Subject: Streamlined the Fibonacci program somewhat. --- mem/mem.hex | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'mem') 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 @@ @0 -040 // acc= 0x40 -f20 // idx 000 // loop: acc= 0 -100 // load +140 // load 0x40 300 // ifeq 0 402 // jmp fib f44 // ++idx tx 4fa // jmp loop -040 // fib: acc= 0x40 -f20 // idx -000 // acc= 0 -200 // store -f04 // ++idx +f20 // fib: idx +240 // store 0x40 001 // acc= 1 -200 // store -f08 // fibloop: --idx -000 // acc= 0 -100 // load -f44 // ++idx tx -100 // load -f04 // ++idx -200 // store -4f8 // jmp fibloop +241 // store 0x41 +000 // fibloop: acc= 0 +140 // load 0x40 +f44 // tx ++idx +140 // load 0x40 +241 // store 0x41 +4fa // jmp fibloop @40 -- cgit v1.2.3