-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.tal
464 lines (419 loc) · 12.4 KB
/
tests.tal
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
( Opcode Tester )
( Requirements:
EQU/EQU2 should put #00 or #01 on the stack
#18 DEO should output ascii character to console )
%EMIT { #18 DEO }
%TEST-SHORT { EQU2 #30 ADD EMIT }
%TEST-BYTE { EQU #30 ADD EMIT }
%MODE { #20 EMIT }
%OPCODE { #0a EMIT }
%TYPE { OPCODE OPCODE }
|0000
@zeropage
&byte $1 &short $2
|0100
( Logic )
( EQU )
#f8 #f8 EQU [ #01 ] TEST-BYTE
#01 #01 EQU [ #01 ] TEST-BYTE
#f8 #01 EQU [ #00 ] TEST-BYTE
#01 #f8 EQU [ #00 ] TEST-BYTE
MODE
#f801 #f801 EQU2 [ #01 ] TEST-BYTE
#01f8 #01f8 EQU2 [ #01 ] TEST-BYTE
#f801 #01f8 EQU2 [ #00 ] TEST-BYTE
#01f8 #f801 EQU2 [ #00 ] TEST-BYTE
MODE
#f8 #f8 EQUk ADD ADD [ #f1 ] TEST-BYTE
#01 #01 EQUk ADD ADD [ #03 ] TEST-BYTE
#f8 #01 EQUk ADD ADD [ #f9 ] TEST-BYTE
#01 #f8 EQUk ADD ADD [ #f9 ] TEST-BYTE
MODE
#f801 #f801 EQU2k #00 ADD2 ADD2 [ #f102 ] TEST-SHORT
#01f8 #01f8 EQU2k #00 ADD2 ADD2 [ #04f0 ] TEST-SHORT
#f801 #01f8 EQU2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT
#01f8 #f801 EQU2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT
OPCODE
( NEQ )
#f8 #f8 NEQ [ #00 ] TEST-BYTE
#01 #01 NEQ [ #00 ] TEST-BYTE
#f8 #01 NEQ [ #01 ] TEST-BYTE
#01 #f8 NEQ [ #01 ] TEST-BYTE
MODE
#f801 #f801 NEQ2 [ #00 ] TEST-BYTE
#01f8 #01f8 NEQ2 [ #00 ] TEST-BYTE
#f801 #01f8 NEQ2 [ #01 ] TEST-BYTE
#01f8 #f801 NEQ2 [ #01 ] TEST-BYTE
MODE
#f8 #f8 NEQk ADD ADD [ #f0 ] TEST-BYTE
#01 #01 NEQk ADD ADD [ #02 ] TEST-BYTE
#f8 #01 NEQk ADD ADD [ #fa ] TEST-BYTE
#01 #f8 NEQk ADD ADD [ #fa ] TEST-BYTE
MODE
#f801 #f801 NEQ2k #00 ADD2 ADD2 [ #f002 ] TEST-SHORT
#01f8 #01f8 NEQ2k #00 ADD2 ADD2 [ #03f0 ] TEST-SHORT
#f801 #01f8 NEQ2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT
#01f8 #f801 NEQ2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT
OPCODE
( GTH )
#f8 #f8 GTH [ #00 ] TEST-BYTE
#01 #01 GTH [ #00 ] TEST-BYTE
#f8 #01 GTH [ #01 ] TEST-BYTE
#01 #f8 GTH [ #00 ] TEST-BYTE
MODE
#f801 #f801 GTH2 [ #00 ] TEST-BYTE
#01f8 #01f8 GTH2 [ #00 ] TEST-BYTE
#f801 #01f8 GTH2 [ #01 ] TEST-BYTE
#01f8 #f801 GTH2 [ #00 ] TEST-BYTE
MODE
#f8 #f8 GTHk ADD ADD [ #f0 ] TEST-BYTE
#01 #01 GTHk ADD ADD [ #02 ] TEST-BYTE
#f8 #01 GTHk ADD ADD [ #fa ] TEST-BYTE
#01 #f8 GTHk ADD ADD [ #f9 ] TEST-BYTE
MODE
#f801 #f801 GTH2k #00 ADD2 ADD2 [ #f002 ] TEST-SHORT
#01f8 #01f8 GTH2k #00 ADD2 ADD2 [ #03f0 ] TEST-SHORT
#f801 #01f8 GTH2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT
#01f8 #f801 GTH2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT
OPCODE
( LTH )
#f8 #f8 LTH [ #00 ] TEST-BYTE
#01 #01 LTH [ #00 ] TEST-BYTE
#f8 #01 LTH [ #00 ] TEST-BYTE
#01 #f8 LTH [ #01 ] TEST-BYTE
MODE
#f801 #f801 LTH2 [ #00 ] TEST-BYTE
#01f8 #01f8 LTH2 [ #00 ] TEST-BYTE
#f801 #01f8 LTH2 [ #00 ] TEST-BYTE
#01f8 #f801 LTH2 [ #01 ] TEST-BYTE
MODE
#f8 #f8 LTHk ADD ADD [ #f0 ] TEST-BYTE
#01 #01 LTHk ADD ADD [ #02 ] TEST-BYTE
#f8 #01 LTHk ADD ADD [ #f9 ] TEST-BYTE
#01 #f8 LTHk ADD ADD [ #fa ] TEST-BYTE
MODE
#f801 #f801 LTH2k #00 ADD2 ADD2 [ #f002 ] TEST-SHORT
#01f8 #01f8 LTH2k #00 ADD2 ADD2 [ #03f0 ] TEST-SHORT
#f801 #01f8 LTH2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT
#01f8 #f801 LTH2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT
TYPE
( Arithmetic )
( ADD )
#ff #00 ADD [ #ff ] TEST-BYTE
#01 #ff ADD [ #00 ] TEST-BYTE
#ff #ff ADD [ #fe ] TEST-BYTE
#fe #ff ADD [ #fd ] TEST-BYTE
MODE
#ffff #0000 ADD2 [ #ffff ] TEST-SHORT
#0001 #ffff ADD2 [ #0000 ] TEST-SHORT
#ffff #ffff ADD2 [ #fffe ] TEST-SHORT
#fffe #ffff ADD2 [ #fffd ] TEST-SHORT
MODE
#ff #00 ADDk ADD ADD [ #fe ] TEST-BYTE
#01 #ff ADDk ADD ADD [ #00 ] TEST-BYTE
#ff #ff ADDk ADD ADD [ #fc ] TEST-BYTE
#fe #ff ADDk ADD ADD [ #fa ] TEST-BYTE
MODE
#ffff #0000 ADD2k ADD2 ADD2 [ #fffe ] TEST-SHORT
#0001 #ffff ADD2k ADD2 ADD2 [ #0000 ] TEST-SHORT
#ffff #ffff ADD2k ADD2 ADD2 [ #fffc ] TEST-SHORT
#fffe #ffff ADD2k ADD2 ADD2 [ #fffa ] TEST-SHORT
OPCODE
( SUB )
#ff #00 SUB [ #ff ] TEST-BYTE
#01 #ff SUB [ #02 ] TEST-BYTE
#ff #ff SUB [ #00 ] TEST-BYTE
#fe #ff SUB [ #ff ] TEST-BYTE
MODE
#ffff #0000 SUB2 [ #ffff ] TEST-SHORT
#0001 #ffff SUB2 [ #0002 ] TEST-SHORT
#ffff #ffff SUB2 [ #0000 ] TEST-SHORT
#fffe #ffff SUB2 [ #ffff ] TEST-SHORT
MODE
#ff #00 SUBk ADD ADD [ #fe ] TEST-BYTE
#01 #ff SUBk ADD ADD [ #02 ] TEST-BYTE
#ff #ff SUBk ADD ADD [ #fe ] TEST-BYTE
#fe #ff SUBk ADD ADD [ #fc ] TEST-BYTE
MODE
#ffff #0000 SUB2k ADD2 ADD2 [ #fffe ] TEST-SHORT
#0001 #ffff SUB2k ADD2 ADD2 [ #0002 ] TEST-SHORT
#ffff #ffff SUB2k ADD2 ADD2 [ #fffe ] TEST-SHORT
#fffe #ffff SUB2k ADD2 ADD2 [ #fffc ] TEST-SHORT
OPCODE
( MUL )
#00 #01 MUL [ #00 ] TEST-BYTE
#3f #e7 MUL [ #d9 ] TEST-BYTE
#37 #3f MUL [ #89 ] TEST-BYTE
#10 #02 MUL [ #20 ] TEST-BYTE
MODE
#1000 #0003 MUL2 [ #3000 ] TEST-SHORT
#abcd #1234 MUL2 [ #4fa4 ] TEST-SHORT
#8000 #0200 MUL2 [ #0000 ] TEST-SHORT
#2222 #0003 MUL2 [ #6666 ] TEST-SHORT
MODE
#00 #01 MULk ADD ADD [ #01 ] TEST-BYTE
#3f #e7 MULk ADD ADD [ #ff ] TEST-BYTE
#37 #3f MULk ADD ADD [ #ff ] TEST-BYTE
#10 #02 MULk ADD ADD [ #32 ] TEST-BYTE
MODE
#1000 #0003 MUL2k ADD2 ADD2 [ #4003 ] TEST-SHORT
#abcd #1234 MUL2k ADD2 ADD2 [ #0da5 ] TEST-SHORT
#8000 #0200 MUL2k ADD2 ADD2 [ #8200 ] TEST-SHORT
#2222 #0003 MUL2k ADD2 ADD2 [ #888b ] TEST-SHORT
OPCODE
( DIV )
#10 #02 DIV [ #08 ] TEST-BYTE
#20 #20 DIV [ #01 ] TEST-BYTE
#34 #01 DIV [ #34 ] TEST-BYTE
#02 #ef DIV [ #00 ] TEST-BYTE
MODE
#1000 #0040 DIV2 [ #0040 ] TEST-SHORT
#abcd #1234 DIV2 [ #0009 ] TEST-SHORT
#8000 #0200 DIV2 [ #0040 ] TEST-SHORT
#2222 #0003 DIV2 [ #0b60 ] TEST-SHORT
MODE
#10 #02 DIVk ADD ADD [ #1a ] TEST-BYTE
#20 #20 DIVk ADD ADD [ #41 ] TEST-BYTE
#34 #01 DIVk ADD ADD [ #69 ] TEST-BYTE
#02 #ef DIVk ADD ADD [ #f1 ] TEST-BYTE
MODE
#1000 #0040 DIV2k ADD2 ADD2 [ #1080 ] TEST-SHORT
#abcd #1234 DIV2k ADD2 ADD2 [ #be0a ] TEST-SHORT
#8000 #0200 DIV2k ADD2 ADD2 [ #8240 ] TEST-SHORT
#2222 #0003 DIV2k ADD2 ADD2 [ #2d85 ] TEST-SHORT
TYPE
( Stack )
( INC )
#01 INC [ #02 ] TEST-BYTE
#ff INC [ #00 ] TEST-BYTE
#fe INC [ #ff ] TEST-BYTE
#00 INC [ #01 ] TEST-BYTE
MODE
#0001 INC2 [ #0002 ] TEST-SHORT
#ffff INC2 [ #0000 ] TEST-SHORT
#fffe INC2 [ #ffff ] TEST-SHORT
#0000 INC2 [ #0001 ] TEST-SHORT
MODE
#01 INCk ADD [ #03 ] TEST-BYTE
#ff INCk ADD [ #ff ] TEST-BYTE
#fe INCk ADD [ #fd ] TEST-BYTE
#00 INCk ADD [ #01 ] TEST-BYTE
MODE
#0001 INC2k ADD2 [ #0003 ] TEST-SHORT
#ffff INC2k ADD2 [ #ffff ] TEST-SHORT
#fffe INC2k ADD2 [ #fffd ] TEST-SHORT
#0000 INC2k ADD2 [ #0001 ] TEST-SHORT
OPCODE
( POP )
#0a #0b POP [ #0a ] TEST-BYTE
#0a #0b #0c POP POP [ #0a ] TEST-BYTE
#0a #0b #0c ADD POP [ #0a ] TEST-BYTE
#0a #0b #0c POP ADD [ #15 ] TEST-BYTE
MODE
#0a0b #0c0d POP2 [ #0a0b ] TEST-SHORT
#0a0b #0c0d #0e0f POP2 POP2 [ #0a0b ] TEST-SHORT
#0a0b #0c0d #0e0f ADD2 POP2 [ #0a0b ] TEST-SHORT
#0a0b #0c0d #0e0f POP2 ADD2 [ #1618 ] TEST-SHORT
MODE
#0a #0b POPk [ #0b ] TEST-BYTE POP
#0a #0b #0c POPk POP [ #0b ] TEST-BYTE POP
#0a #0b #0c ADD POPk [ #17 ] TEST-BYTE POP
#0a #0b #0c POPk ADD [ #17 ] TEST-BYTE POP
MODE
#0a0b #0c0d POP2k [ #0c0d ] TEST-SHORT POP2
#0a0b #0c0d #0e0f POP2k POP2 [ #0c0d ] TEST-SHORT POP2
#0a0b #0c0d #0e0f ADD2 POP2k [ #1a1c ] TEST-SHORT POP2
#0a0b #0c0d #0e0f POP2k ADD2 [ #1a1c ] TEST-SHORT POP2
OPCODE
( DUP )
#0a #0b DUP ADD ADD [ #20 ] TEST-BYTE
MODE
#0a0b DUP2 ADD2 [ #1416 ] TEST-SHORT
MODE
#0a #0b DUPk ADD ADD ADD [ #2b ] TEST-BYTE
MODE
#0a0b DUP2k ADD2 ADD2 [ #1e21 ] TEST-SHORT
OPCODE
( NIP )
#12 #34 #56 NIP ADD [ #68 ] TEST-BYTE
MODE
#1234 #5678 #9abc NIP2 ADD2 [ #acf0 ] TEST-SHORT
MODE
#12 #34 #56 NIPk ADD ADD [ #e0 ] TEST-BYTE POP
MODE
#1234 #5678 #9abc NIP2k ADD2 ADD2 [ #8bf0 ] TEST-SHORT POP2
OPCODE
( SWP )
#02 #10 SWP DIV [ #08 ] TEST-BYTE
MODE
#0a0b #0c0d SWP2 NIP2 [ #0a0b ] TEST-SHORT
MODE
#02 #10 SWPk DIV ADD ADD [ #1a ] TEST-BYTE
MODE
#0a0b #0c0d SWP2k POP2 POP2 POP2 [ #0a0b ] TEST-SHORT
OPCODE
( OVR )
#02 #10 OVR DIV ADD [ #0a ] TEST-BYTE
MODE
#0a0b #0c0d OVR2 NIP2 ADD2 [ #1416 ] TEST-SHORT
MODE
#02 #10 OVRk DIV ADD ADD ADD [ #1c ] TEST-BYTE
MODE
#0a0b #0c0d OVR2k NIP2 ADD2 ADD2 ADD2 [ #2a2e ] TEST-SHORT
OPCODE
( ROT )
#02 #04 #10 ROT DIV ADD [ #0c ] TEST-BYTE
MODE
#0a0b #0c0d #0c0f ROT2 ADD2 NIP2 [ #161a ] TEST-SHORT
MODE
#02 #04 #10 ROTk DIV ADD ADD ADD ADD [ #22 ] TEST-BYTE
MODE
#0a0b #0c0d #0c0f ROT2k ADD2 NIP2 ADD2 ADD2 ADD2 [ #3841 ] TEST-SHORT
TYPE
( Bitwise )
( AND )
#fc #3f AND [ #3c ] TEST-BYTE
#f0 #0f AND [ #00 ] TEST-BYTE
#ff #3c AND [ #3c ] TEST-BYTE
#02 #03 AND [ #02 ] TEST-BYTE
MODE
#f0f0 #00f0 AND2 [ #00f0 ] TEST-SHORT
#aaaa #5555 AND2 [ #0000 ] TEST-SHORT
#ffff #1234 AND2 [ #1234 ] TEST-SHORT
#abcd #0a0c AND2 [ #0a0c ] TEST-SHORT
MODE
#fc #3f ANDk ADD ADD [ #77 ] TEST-BYTE
#f0 #0f ANDk ADD ADD [ #ff ] TEST-BYTE
#ff #3c ANDk ADD ADD [ #77 ] TEST-BYTE
#02 #03 ANDk ADD ADD [ #07 ] TEST-BYTE
MODE
#f0f0 #00f0 AND2k ADD2 ADD2 [ #f2d0 ] TEST-SHORT
#aaaa #5555 AND2k ADD2 ADD2 [ #ffff ] TEST-SHORT
#ffff #1234 AND2k ADD2 ADD2 [ #2467 ] TEST-SHORT
#abcd #0a0c AND2k ADD2 ADD2 [ #bfe5 ] TEST-SHORT
OPCODE
( ORA )
#0f #f0 ORA [ #ff ] TEST-BYTE
#ab #cd ORA [ #ef ] TEST-BYTE
#12 #34 ORA [ #36 ] TEST-BYTE
#88 #10 ORA [ #98 ] TEST-BYTE
MODE
#0f0f #f0f0 ORA2 [ #ffff ] TEST-SHORT
#abab #cdcd ORA2 [ #efef ] TEST-SHORT
#1122 #1234 ORA2 [ #1336 ] TEST-SHORT
#8888 #1000 ORA2 [ #9888 ] TEST-SHORT
MODE
#0f #f0 ORAk ADD ADD [ #fe ] TEST-BYTE
#ab #cd ORAk ADD ADD [ #67 ] TEST-BYTE
#12 #34 ORAk ADD ADD [ #7c ] TEST-BYTE
#88 #10 ORAk ADD ADD [ #30 ] TEST-BYTE
MODE
#0f0f #f0f0 ORA2k ADD2 ADD2 [ #fffe ] TEST-SHORT
#abab #cdcd ORA2k ADD2 ADD2 [ #6967 ] TEST-SHORT
#1122 #1234 ORA2k ADD2 ADD2 [ #368c ] TEST-SHORT
#8888 #1000 ORA2k ADD2 ADD2 [ #3110 ] TEST-SHORT
OPCODE
( EOR )
#00 #00 EOR [ #00 ] TEST-BYTE
#ff #00 EOR [ #ff ] TEST-BYTE
#aa #55 EOR [ #ff ] TEST-BYTE
#ff #ff EOR [ #00 ] TEST-BYTE
MODE
#ffff #ff00 EOR2 [ #00ff ] TEST-SHORT
#aaaa #5555 EOR2 [ #ffff ] TEST-SHORT
#1122 #1234 EOR2 [ #0316 ] TEST-SHORT
#8888 #1000 EOR2 [ #9888 ] TEST-SHORT
MODE
#00 #00 EORk ADD ADD [ #00 ] TEST-BYTE
#ff #00 EORk ADD ADD [ #fe ] TEST-BYTE
#aa #55 EORk ADD ADD [ #fe ] TEST-BYTE
#ff #ff EORk ADD ADD [ #fe ] TEST-BYTE
MODE
#ffff #ff00 EOR2k ADD2 ADD2 [ #fffe ] TEST-SHORT
#aaaa #5555 EOR2k ADD2 ADD2 [ #fffe ] TEST-SHORT
#1122 #1234 EOR2k ADD2 ADD2 [ #266c ] TEST-SHORT
#8888 #1000 EOR2k ADD2 ADD2 [ #3110 ] TEST-SHORT
OPCODE
( SFT )
#ff #08 SFT [ #00 ] TEST-BYTE
#ff #e0 SFT [ #00 ] TEST-BYTE
#ff #11 SFT [ #fe ] TEST-BYTE
#ff #12 SFT [ #7e ] TEST-BYTE
MODE
#ffff #01 SFT2 [ #7fff ] TEST-SHORT
#ffff #70 SFT2 [ #ff80 ] TEST-SHORT
#ffff #7e SFT2 [ #0180 ] TEST-SHORT
#ffff #e3 SFT2 [ #c000 ] TEST-SHORT
MODE
#ff #08 SFTk ADD ADD [ #07 ] TEST-BYTE
#ff #e0 SFTk ADD ADD [ #df ] TEST-BYTE
#ff #11 SFTk ADD ADD [ #0e ] TEST-BYTE
#ff #12 SFTk ADD ADD [ #8f ] TEST-BYTE
MODE
#ffff #01 SFT2k ROT POP ADD2 [ #7ffe ] TEST-SHORT
#ffff #70 SFT2k ROT POP ADD2 [ #ff7f ] TEST-SHORT
#ffff #7e SFT2k ROT POP ADD2 [ #017f ] TEST-SHORT
#ffff #e3 SFT2k ROT POP ADD2 [ #bfff ] TEST-SHORT
TYPE
( Memory )
( STZ/LDZ )
#ab .zeropage/byte STZ .zeropage/byte LDZ [ #ab ] TEST-BYTE
#cd .zeropage/byte STZ .zeropage/byte LDZ [ #cd ] TEST-BYTE
MODE
#1234 .zeropage/short STZ2 .zeropage/short LDZ2 [ #1234 ] TEST-SHORT
#5678 .zeropage/short STZ2 .zeropage/short LDZ2 [ #5678 ] TEST-SHORT
OPCODE
( STR/LDR )
[ LIT &before1 $1 ] POP
[ LIT2 &before2 $2 ] POP2
#22 ,&before1 STR ,&before1 LDR [ #22 ] TEST-BYTE
#ef ,&after1 STR ,&after1 LDR [ #ef ] TEST-BYTE
MODE
#1234 ,&before2 STR2 ,&before2 LDR2 [ #1234 ] TEST-SHORT
#5678 ,&after2 STR2 ,&after2 LDR2 [ #5678 ] TEST-SHORT
[ LIT &after1 $1 ] POP
[ LIT2 &after2 $2 ] POP2
OPCODE
( STA/LDA )
#34 ;absolute/byte STA ;absolute/byte LDA [ #34 ] TEST-BYTE
#56 ;absolute/byte STA ;absolute/byte LDA [ #56 ] TEST-BYTE
MODE
#1234 ;absolute/short STA2 ;absolute/short LDA2 [ #1234 ] TEST-SHORT
#5678 ;absolute/short STA2 ;absolute/short LDA2 [ #5678 ] TEST-SHORT
OPCODE
( DEI/DEO )
LIT "1 EMIT
LIT "1 EMIT
TYPE
( Branching )
( JMP )
#12 #34 ,&reljmp JMP SWP &reljmp POP [ #12 ] TEST-BYTE
MODE
#56 #78 ;&absjmp JMP2 SWP &absjmp POP [ #56 ] TEST-BYTE
OPCODE
( JCN )
#23 #01 ,&reljcn-y JCN INC &reljcn-y [ #23 ] TEST-BYTE
#23 #00 ,&reljcn-n JCN INC &reljcn-n [ #24 ] TEST-BYTE
MODE
#23 #01 ;&absjcn-y JCN2 INC &absjcn-y [ #23 ] TEST-BYTE
#23 #00 ;&absjcn-n JCN2 INC &absjcn-n [ #24 ] TEST-BYTE
OPCODE
( JSR - Requires return mode )
#12 #34 ;routine JSR2 [ #46 ] TEST-BYTE
OPCODE
( STH )
#0a STH #0b STH ADDr STHr [ #15 ] TEST-BYTE
MODE
#000a STH2 #000b STH2 ADD2r STH2r [ #0015 ] TEST-SHORT
TYPE
( Keep )
#12 #34 ADDk ADD ADD [ #8c ] TEST-BYTE
OPCODE
#010e DEO
#010f DEO
BRK
@routine ( a b -- c )
ADD
JMP2r
@absolute
&byte $1 &short $2