-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathout
More file actions
249 lines (217 loc) · 3.35 KB
/
out
File metadata and controls
249 lines (217 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
INF 9001
;Start of code from TestNK
#a comment
NND lit[F]
NND N_[F]
#Trying a nested Macro
STR macro[0]
LOD N_[0]
ADD N_[0]
LOD macro[0]
NND N_[F]
ADD N_[1]
#The carry macro
LOD N_[0]
ADD N_[0]
#Test out the include statements!
;Included TestINCL
#simple acc stuff - being exhaustive in my tests
STR macro[0]
LOD N_[0]
ADD N_[0]
LOD macro[0]
ADD N_[1]
STR macro[0]
LOD N_[0]
ADD N_[0]
LOD macro[0]
ADD N_[F]
#shifts
STR macro[0]
LOD N_[0]
ADD N_[0]
LOD macro[0]
ADD macro[0]
STR macro[0]
LOD N_[0]
ADD N_[0]
LOD macro[0]
ADD macro[0]
ADD N_[0]
label:
#unary macros! Testing simple first
LOD lit[f]
STR place[0]
#testing that the math works
LOD place[3]
STR elsewhere[a]
LOD place[4]
STR elsewhere[b]
LOD place[5]
STR elsewhere[c]
LOD place[6]
STR elsewhere[d]
LOD place[7]
STR elsewhere[e]
LOD place[8]
STR elsewhere[f]
LOD place[9]
STR elsewhere[10]
LOD place[a]
STR elsewhere[11]
LOD place[b]
STR elsewhere[12]
LOD place[c]
STR elsewhere[13]
LOD place[d]
STR elsewhere[14]
LOD place[e]
STR elsewhere[15]
LOD place[f]
STR elsewhere[16]
LOD place[10]
STR elsewhere[17]
LOD place[11]
STR elsewhere[18]
LOD place[12]
STR elsewhere[19]
#does recursion between acc and unary work?
LOD somewhere[1f]
NND N_[F]
STR place[0]
#more complex recursion - 8-bit negations!
LOD N_[0]
ADD N_[0]
LOD source[1]
NND N_[F]
ADD N_[1]
STR dest[1]
LOD source[0]
NND N_[F]
ADD N_[0]
STR dest[0]
#test addition
LOD N_[0]
ADD N_[0]
LOD num[1]
ADD othernum[1]
STR sum[1]
LOD num[0]
ADD othernum[0]
STR sum[0]
#subtraction uses lots of macro memory
LOD N_[8]
ADD N_[8]
LOD firstop[7]
NND N_[F]
ADD firstop[7]
STR dest[7]
LOD secondop[6]
NND N_[F]
ADD firstop[6]
STR dest[6]
LOD secondop[5]
NND N_[F]
ADD firstop[5]
STR dest[5]
LOD secondop[4]
NND N_[F]
ADD firstop[4]
STR dest[4]
LOD secondop[3]
NND N_[F]
ADD firstop[3]
STR dest[3]
LOD secondop[2]
NND N_[F]
ADD firstop[2]
STR dest[2]
LOD secondop[1]
NND N_[F]
ADD firstop[1]
STR dest[1]
LOD secondop[0]
NND N_[F]
ADD firstop[0]
STR dest[0]
#Addressing operations?
LOD &(place[3])[0]
STR somewhere[0]
LOD &(place[3])[1]
STR somewhere[1]
LOD &(place[3])[2]
STR somewhere[2]
LOD &(place[3])[3]
STR somewhere[3]
#and again
LOD &(somewhere[0])[0]
STR place[3]
LOD &(somewhere[0])[1]
STR place[4]
LOD &(somewhere[0])[2]
STR place[5]
LOD &(somewhere[0])[3]
STR place[6]
;alternate comment syntax
;jump macros?
LOD place[0]
NND N_[f]
STR macro[0]
NND place[0]
STR macro[1]
LOD macro[0]
NND N_[f]
NND macro[1]
STR macro[2]
LOD macro[2]
JMP label[0]
#Letting people use whatever the hell value type they want
LOD N_[5]
STR label[0]
LOD N_[b]
STR label[0]
LOD N_[8]
STR label[0]
LOD label[10]
STR label[0]
#Now less picky! Assumes INTO $op1 if no dest given
LOD N_[0]
ADD N_[0]
LOD this[2]
NND N_[F]
ADD N_[1]
STR this[2]
LOD this[1]
NND N_[F]
ADD N_[0]
STR this[1]
;End of code from TestNK
;Start of code from TestINCL
#this is from TestINCL!
LOD &(myData[0])[0]
STR myPointer[0]
LOD &(myData[0])[1]
STR myPointer[1]
LOD &(myData[0])[2]
STR myPointer[2]
LOD &(myData[0])[3]
STR myPointer[3]
LOD N_[0]
JMP myPointer
#recursive includes should NOT break
;Ignored repeated include: TestNK
HLT
#TestINCL Data
;End of code from TestINCL
;Start of data sections
;Start of data from TestNK
TestData: .data 5
;End of data from TestNK
;Start of data from TestINCL
myData: .data 4
.data 2
#more testINCL data
.data 1
;End of data from TestINCL
;memory space used by macros
macro: .data 3