-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.asm
471 lines (393 loc) · 6.93 KB
/
test.asm
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
465
466
467
468
469
470
471
;-------------------------
; AS09 assember test file
;-------------------------
START:
;----------------------------
; inherent mode instructions
;----------------------------
ABX
ASLA
ASLB
ASRA
ASRB
CLRA
CLRB
COMA
COMB
DAA
DECA
DECB
INCA
INCB
LSLA
LSLB
LSRA
LSRB
MUL
NEGA
NEGB
NOP
ROLA
ROLB
RORA
RORB
RTI
RTS
SEX
SWI
SWI2
SWI3
SYNC
TSTA
TSTB
;-------------------------
; address mode variations
;-------------------------
ADCA #$12
ADCA $12
ADCA $1234
ADCA [$1234]
ADCB #$12
ADCB $12
ADCB $1234
ADCB [$1234]
ADDA #$12
ADDA $12
ADDA $1234
ADDA [$1234]
ADDB #$12
ADDB $12
ADDB $1234
ADDB [$1234]
ADDD #$1234
ADDD $12
ADDD $1234
ADDD [$1234]
ANDA #$12
ANDA $12
ANDA $1234
ANDA [$1234]
ANDB #$12
ANDB $12
ANDB $1234
ANDB [$1234]
ANDCC #$12
ASL $12
ASL $1234
ASL [$1234]
ASR $12
ASR $1234
ASR [$1234]
BITA #$12
BITA $12
BITA $1234
BITA [$1234]
BITB #$12
BITB $12
BITB $1234
BITB [$1234]
CLR $12
CLR $1234
CLR [$1234]
CMPA #$12
CMPA $12
CMPA $1234
CMPA [$1234]
CMPB #$12
CMPB $12
CMPB $1234
CMPB [$1234]
CMPD #$1234
CMPD $12
CMPD $1234
CMPD [$1234]
CMPS #$1234
CMPS $12
CMPS $1234
CMPS [$1234]
CMPU #$1234
CMPU $12
CMPU $1234
CMPU [$1234]
CMPX #$1234
CMPX $12
CMPX $1234
CMPX [$1234]
CMPY #$1234
CMPY $12
CMPY $1234
CMPY [$1234]
COM $12
COM $1234
COM [$1234]
CWAI #$FF
DEC $12
DEC $1234
DEC [$1234]
EORA #$12
EORA $12
EORA $1234
EORA [$1234]
EORB #$12
EORB $12
EORB $1234
EORB [$1234]
INC $12
INC $1234
INC [$1234]
JMP $12
JMP $1234
JMP [$1234]
JSR $12
JSR $1234
JSR [$1234]
LDA #$12
LDA $12
LDA $1234
LDA [$1234]
LDB #$12
LDB $12
LDB $1234
LDB [$1234]
LDD #$1234
LDD $12
LDD $1234
LDD [$1234]
LDS #$1234
LDS $12
LDS $1234
LDS [$1234]
LDU #$1234
LDU $12
LDU $1234
LDU [$1234]
LDX #$1234
LDX $12
LDX $1234
LDX [$1234]
LDY #$1234
LDY $12
LDY $1234
LDY [$1234]
LEAS ,S
LEAU 1,U
LEAX -1,X
LEAY 1,Y
LSL $12
LSL $1234
LSL [$1234]
LSR $12
LSR $1234
LSR [$1234]
NEG $12
NEG $1234
NEG [$1234]
ORA #$12
ORA $12
ORA $1234
ORA [$1234]
ORB #$12
ORB $12
ORB $1234
ORB [$1234]
ORCC #$12
ROL $12
ROL $1234
ROL [$1234]
ROR $12
ROR $1234
ROR [$1234]
SBCA #$12
SBCA $12
SBCA $1234
SBCA [$1234]
SBCB #$12
SBCB $12
SBCB $1234
SBCB [$1234]
STA $12
STA $1234
STA [$1234]
STB $12
STB $1234
STB [$1234]
STD $12
STD $1234
STD [$1234]
STS $12
STS $1234
STS [$1234]
STU $12
STU $1234
STU [$1234]
STX $12
STX $1234
STX [$1234]
STY $12
STY $1234
STY [$1234]
SUBA #$12
SUBA $12
SUBA $1234
SUBA [$1234]
SUBB #$12
SUBB $12
SUBB $1234
SUBB [$1234]
SUBD #$1234
SUBD $12
SUBD $1234
SUBD [$1234]
TST $12
TST $1234
TST [$1234]
;--------------------------------
; register movement instructions
;--------------------------------
EXG A,B
EXG X,Y
TFR A,B
TFR S,U
;--------------------
; stack instructions
;--------------------
PSHS A,B,CC,DP,U,X,Y,PC
PSHU CC,D,DP,S,X,Y,PC
PULS CC,D,DP,U,X,Y,PC
PULU A,B,CC,DP,S,X,Y,PC
;---------------------
; branch instructions
;---------------------
BACK:
BCC BACK
BCS FORWARD
BEQ BACK
BGE FORWARD
BGT BACK
BHI FORWARD
BHS BACK
BLE FORWARD
BLO BACK
BLS FORWARD
BLT BACK
BMI FORWARD
BNE BACK
BPL FORWARD
BRA BACK
BRN FORWARD
BSR BACK
BVC FORWARD
BVS BACK
FORWARD:
LBRANCH:
LBCC LBRANCH
LBCS LBRANCH
LBEQ LBRANCH
LBGE LBRANCH
LBGT LBRANCH
LBHI LBRANCH
LBHS LBRANCH
LBLE LBRANCH
LBLO LBRANCH
LBLS LBRANCH
LBLT LBRANCH
LBMI LBRANCH
LBNE LBRANCH
LBPL LBRANCH
LBRA LBRANCH
LBRN LBRANCH
LBSR LBRANCH
LBVC LBRANCH
LBVS LBRANCH
;--------------------
; indexed addressing
;--------------------
ADDA ,X
ADDA ,X+
ADDA ,X++
ADDA ,-X
ADDA ,--X
ADDA $9,X
ADDA -$9,X
ADDA $78,X
ADDA -$78,X
ADDA $1234,X
ADDA -$1234,X
ADDA ,Y
ADDA ,Y+
ADDA ,Y++
ADDA ,-Y
ADDA ,--Y
ADDA $9,Y
ADDA -$9,Y
ADDA $78,Y
ADDA -$78,Y
ADDA $1234,Y
ADDA -$1234,Y
ADDA ,U
ADDA ,U++
ADDA ,-U
ADDA ,--U
ADDA $9,U
ADDA -$9,U
ADDA $78,U
ADDA -$78,U
ADDA $1234,U
ADDA -$1234,U
ADDA ,S
ADDA ,S++
ADDA ,-S
ADDA ,--S
ADDA $9,S
ADDA -$9,S
ADDA $78,S
ADDA -$78,S
ADDA $1234,S
ADDA -$1234,S
ADDA [,X]
ADDA [,X++]
ADDA [,--X]
ADDA [$9,X]
ADDA [-$9,X]
ADDA [$78,X]
ADDA [-$78,X]
ADDA [$1234,X]
ADDA [-$1234,X]
ADDA [,Y]
ADDA [,Y++]
ADDA [,--Y]
ADDA [$9,Y]
ADDA [-$9,Y]
ADDA [$78,Y]
ADDA [-$78,Y]
ADDA [$1234,Y]
ADDA [-$1234,Y]
ADDA [,U]
ADDA [,--U]
ADDA [$9,U]
ADDA [-$9,U]
ADDA [$78,U]
ADDA [-$78,U]
ADDA [$1234,U]
ADDA [-$1234,U]
ADDA [,S]
ADDA [,--S]
ADDA [$9,S]
ADDA [-$9,S]
ADDA [$78,S]
ADDA [-$78,S]
ADDA [$1234,S]
ADDA [-$1234,S]
ADDA A,X
ADDA B,Y
ADDA D,U
ADDA A,S
ADDA [A,X]
ADDA [B,Y]
ADDA [D,U]
ADDA [A,S]
LDA $1234,PCR
LDA -$1234,PCR
LDA [$1234,PCR]
LDA [-$1234,PCR]
END START