summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mem/mem.hex125
1 files changed, 0 insertions, 125 deletions
diff --git a/mem/mem.hex b/mem/mem.hex
deleted file mode 100644
index 8619b48..0000000
--- a/mem/mem.hex
+++ /dev/null
@@ -1,125 +0,0 @@
1@0
2
3508 // jmp start
4000 // i: 0 # outer loop index
5000 // ascii0: 0 # ascii digits must be in consecutive incrementing addresses
6000 // ascii1: 0
7000 // ascii2: 0
8000 // ascii3: 0
9000 // fib0: j: 0 # fib[n]; clobbered by ascii printer for inner loop index
10000 // fib1: x: 0 # fib[n+1]; clobbered by ascii printer for digit being printed
11000 // fib2: 0 # fib[n+2]
12116 // start: acc= @echo # for the toy indirect jump to fib
13307 // store @x
14170 // acc= 0x70
15301 // store @i
16001 // loop: cla
17281 // ladd i @i
18400 // ifeq 0
19587 // jmp i @x # toy indirect jump to fib
20040 // tx
21003 // cla ++acc
22201 // ladd @i
23301 // store @i
24577 // jmp loop
25080 // echo: rx
2640a // ifeq 0x0a
27504 // jmp fib
2840d // ifeq 0x0d
29502 // jmp fib
30040 // tx
31579 // jmp echo
3210d // fib: acc= 0x0d
33040 // tx
3410a // acc= 0x0a
35040 // tx
36001 // cla
37301 // store @i
38370 // store 0x70 # 0x70 is now beginning of Fibonacci sequence (0)
39003 // cla ++acc
40371 // store 0x71 # 0x71 is 1
41170 // fibloop: acc= 0x70
42201 // ladd @i
43306 // store @fib0
44001 // cla
45286 // ladd i @fib0 # next fib number to print
46602 // ascii @ascii0 # LSB of ASCII rep
47603 // ascii @ascii1
48604 // ascii @ascii2
49605 // ascii @ascii3 # MSB of ASCII rep
50104 // acc= 4
51306 // store @j
52005 // scan: cla --acc
53206 // ladd @j
544ff // ifeq -1
55508 // jmp print
56306 // store @j
57102 // acc= @ascii0
58206 // ladd @j
59307 // store @x
60001 // cla
61287 // ladd i @x
62430 // ifeq 0x30
63574 // jmp scan
64102 // print: acc= @ascii0
65206 // ladd @j
66307 // store @x
67001 // cla
68287 // ladd i @x
69040 // tx
70005 // cla --acc
71206 // ladd @j
724ff // ifeq -1
73502 // jmp space
74306 // store @j
75574 // jmp print
76120 // space: acc= 0x20
77040 // tx
78170 // acc= 0x70
79201 // ladd @i
80306 // store @fib0
81003 // cla ++acc
82206 // ladd @fib0 # compute &fib[i+1]
83307 // store @fib1
84003 // cla ++acc
85207 // ladd @fib1 # compute &fib[i+2]
86308 // store @fib2
87001 // cla
88286 // ladd i @fib0
89287 // ladd i @fib1 # compute fib[i+2]
90388 // store i @fib2 # store it
91003 // cla ++acc
92201 // ladd @i
93432 // ifeq 50
94502 // jmp fullydone
95301 // store @i
96548 // jmp fibloop
97121 // fullydone: acc= 0x21
98040 // tx
99000 // halt
100
101@70
102
103048 // H # later: start of in-memory Fib sequence
104065 // e
10506c // l
10606c // l
10706f // o
10802c // ,
109020 // ' '
110077 // w
11106f // o
112072 // r
11306c // l
114064 // d
115021 // !
11600d // \r
11700a // \n
118045 // E
119063 // c
120068 // h
12106f // o
12203a // :
123020 // ' '
124
125000