OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [tools/] [opcodes.asm] - Blame information for rev 29

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 rhoads
##################################################################
2
# TITLE: Opcode Tester
3
# AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
4
# DATE CREATED: 1/10/02
5
# FILENAME: opcodes.asm
6
# PROJECT: MIPS CPU core
7
# COPYRIGHT: Software placed into the public domain by the author.
8
#    Software 'as is' without warranty.  Author liable for nothing.
9
# DESCRIPTION:
10
#    This assembly file tests all of the opcodes supported by the
11
#    MIPS-lite core.
12
#    This test assumes that address 0xffff is the UART write register
13
#    Successful tests will print out "A" or "AB" or "ABC" or ....
14
#    Missing letters or letters out of order indicate a failure.
15
##################################################################
16
        .text
17
        .align  2
18
        .globl  entry
19
        .ent    entry
20
entry:
21
   .set noreorder
22
 
23 29 rhoads
   #These four instructions must be the first instructions
24
   #convert.exe will correctly initialize $gp
25
   lui   $gp,0
26
   ori   $gp,$gp,0
27
   #convert.exe will set $4=.sbss_start $5=.bss_end
28
   ori   $4,$0,0
29
   ori   $5,$0,0
30
 
31 23 rhoads
   mtc0  $0,$12             #disable interrupts
32 15 rhoads
   ori   $20,$0,0xffff      #serial port write address
33
   ori   $21,$0,'\n'        # letter
34
   ori   $22,$0,'X'         #'X' letter
35
 
36
   ######################################
37
   #Arithmetic Instructions
38
   ######################################
39
   ori   $2,$0,'A'
40
   sb    $2,0($20)
41
   ori   $2,$0,'r'
42
   sb    $2,0($20)
43
   ori   $2,$0,'i'
44
   sb    $2,0($20)
45
   ori   $2,$0,'t'
46
   sb    $2,0($20)
47
   ori   $2,$0,'h'
48
   sb    $2,0($20)
49
   sb    $21,0($20)
50
 
51 23 rhoads
   #a: ADD
52
   ori   $2,$0,'a'
53
   sb    $2,0($20)
54 15 rhoads
   ori   $3,$0,5
55
   ori   $4,$0,60
56
   add   $2,$3,$4
57 23 rhoads
   sb    $2,0($20)    #A
58 15 rhoads
   sb    $21,0($20)
59
 
60 23 rhoads
   #b: ADDI
61
   ori   $2,$0,'b'
62
   sb    $2,0($20)
63 15 rhoads
   ori   $4,$0,60
64
   addi  $2,$4,5
65 23 rhoads
   sb    $2,0($20)    #A
66 15 rhoads
   sb    $21,0($20)
67
 
68 23 rhoads
   #c: ADDIU
69
   ori   $2,$0,'c'
70
   sb    $2,0($20)
71 15 rhoads
   ori   $4,$0,50
72
   addiu $5,$4,15
73 23 rhoads
   sb    $5,0($20)    #A
74 15 rhoads
   sb    $21,0($20)
75
 
76 23 rhoads
   #d: ADDU
77
   ori   $2,$0,'d'
78
   sb    $2,0($20)
79 15 rhoads
   ori   $3,$0,5
80
   ori   $4,$0,60
81
   add   $2,$3,$4
82 23 rhoads
   sb    $2,0($20)    #A
83 15 rhoads
   sb    $21,0($20)
84
 
85 23 rhoads
   #e: DIV
86
   ori   $2,$0,'e'
87
   sb    $2,0($20)
88
   ori   $2,$0,65*117+41
89
   ori   $3,$0,117
90 15 rhoads
   div   $2,$3
91
   nop
92
   mflo  $4
93 23 rhoads
   sb    $4,0($20)    #A
94
   mfhi  $4
95
   addi  $4,$4,66-41
96
   sb    $4,0($20)    #B
97
   li    $2,-67*19
98 15 rhoads
   ori   $3,$0,19
99
   div   $2,$3
100
   nop
101
   mflo  $4
102
   sub   $4,$0,$4
103 23 rhoads
   sb    $4,0($20)    #C
104
   ori   $2,$0,68*23
105 15 rhoads
   li    $3,-23
106
   div   $2,$3
107
   nop
108
   mflo  $4
109
   sub   $4,$0,$4
110 23 rhoads
   sb    $4,0($20)    #D
111
   li    $2,-69*13
112 15 rhoads
   li    $3,-13
113
   div   $2,$3
114
   mflo  $4
115 23 rhoads
   sb    $4,0($20)    #E
116 15 rhoads
   sb    $21,0($20)
117
 
118 23 rhoads
   #f: DIVU
119
   ori   $2,$0,'f'
120
   sb    $2,0($20)
121 15 rhoads
   ori   $2,$0,65*13
122
   ori   $3,$0,13
123 23 rhoads
   divu  $2,$3
124 15 rhoads
   nop
125
   mflo  $4
126 23 rhoads
   sb    $4,0($20)    #A
127 15 rhoads
   sb    $21,0($20)
128
 
129 23 rhoads
   #g: MULT
130
   ori   $2,$0,'g'
131
   sb    $2,0($20)
132 15 rhoads
   ori   $2,$0,5
133
   ori   $3,$0,13
134
   mult  $2,$3
135
   nop
136
   mflo  $4
137 23 rhoads
   sb    $4,0($20)    #A
138 15 rhoads
   li    $2,-5
139
   ori   $3,$0,13
140
   mult  $2,$3
141
   nop
142
   mflo  $4
143
   sub   $4,$0,$4
144
   addi  $4,$4,1
145 23 rhoads
   sb    $4,0($20)    #B
146 15 rhoads
   ori   $2,$0,5
147
   li    $3,-13
148
   mult  $2,$3
149
   nop
150
   mflo  $4
151
   sub   $4,$0,$4
152
   addi  $4,$4,2
153 23 rhoads
   sb    $4,0($20)    #C
154 15 rhoads
   li    $2,-5
155
   li    $3,-13
156
   mult  $2,$3
157
   nop
158
   mflo  $4
159
   addi  $4,$4,3
160 23 rhoads
   sb    $4,0($20)    #D
161 15 rhoads
   sb    $21,0($20)
162
 
163 23 rhoads
   #h: MULTU
164
   ori   $2,$0,'h'
165
   sb    $2,0($20)
166 15 rhoads
   ori   $2,$0,5
167
   ori   $3,$0,13
168 23 rhoads
   multu $2,$3
169 15 rhoads
   nop
170
   mflo  $4
171 23 rhoads
   sb    $4,0($20)    #A
172 15 rhoads
   sb    $21,0($20)
173
 
174 23 rhoads
   #i: SLT
175
   ori   $2,$0,'i'
176
   sb    $2,0($20)
177 15 rhoads
   ori   $2,$0,10
178
   ori   $3,$0,12
179
   slt   $4,$2,$3
180
   addi  $5,$4,64
181 23 rhoads
   sb    $5,0($20)    #A
182 15 rhoads
   slt   $4,$3,$2
183
   addi  $5,$4,66
184 23 rhoads
   sb    $5,0($20)    #B
185 15 rhoads
   li    $2,0xfffffff0
186
   slt   $4,$2,$3
187
   addi  $5,$4,66
188 23 rhoads
   sb    $5,0($20)    #C
189 15 rhoads
   slt   $4,$3,$2
190
   addi  $5,$4,68
191 23 rhoads
   sb    $5,0($20)    #D
192 15 rhoads
   li    $3,0xffffffff
193
   slt   $4,$2,$3
194
   addi  $5,$4,68
195 23 rhoads
   sb    $5,0($20)    #E
196 15 rhoads
   slt   $4,$3,$2
197
   addi  $5,$4,70
198 23 rhoads
   sb    $5,0($20)    #F
199 15 rhoads
   sb    $21,0($20)
200
 
201 23 rhoads
   #j: SLTI
202
   ori   $2,$0,'j'
203
   sb    $2,0($20)
204 15 rhoads
   ori   $2,$0,10
205
   slti  $4,$2,12
206
   addi  $5,$4,64
207 23 rhoads
   sb    $5,0($20)    #A
208 15 rhoads
   slti  $4,$2,8
209
   addi  $5,$4,66
210 23 rhoads
   sb    $5,0($20)    #B
211 15 rhoads
   sb    $21,0($20)
212
 
213 23 rhoads
   #k: SLTIU
214
   ori   $2,$0,'k'
215
   sb    $2,0($20)
216 15 rhoads
   ori   $2,$0,10
217
   sltiu $4,$2,12
218
   addi  $5,$4,64
219 23 rhoads
   sb    $5,0($20)    #A
220 15 rhoads
   sltiu $4,$2,8
221
   addi  $5,$4,66
222 23 rhoads
   sb    $5,0($20)    #B
223 15 rhoads
   sb    $21,0($20)
224
 
225 23 rhoads
   #l: SLTU
226
   ori   $2,$0,'l'
227
   sb    $2,0($20)
228 15 rhoads
   ori   $2,$0,10
229
   ori   $3,$0,12
230
   slt   $4,$2,$3
231
   addi  $5,$4,64
232 23 rhoads
   sb    $5,0($20)    #A
233 15 rhoads
   slt   $4,$3,$2
234
   addi  $5,$4,66
235 23 rhoads
   sb    $5,0($20)    #B
236 15 rhoads
   sb    $21,0($20)
237
 
238 23 rhoads
   #m: SUB
239
   ori   $2,$0,'m'
240
   sb    $2,0($20)
241 15 rhoads
   ori   $3,$0,70
242
   ori   $4,$0,5
243
   sub   $2,$3,$4
244 23 rhoads
   sb    $2,0($20)    #A
245 15 rhoads
   sb    $21,0($20)
246
 
247 23 rhoads
   #n: SUBU
248
   ori   $2,$0,'n'
249
   sb    $2,0($20)
250 15 rhoads
   ori   $3,$0,70
251
   ori   $4,$0,5
252
   sub   $2,$3,$4
253 23 rhoads
   sb    $2,0($20)    #A
254 15 rhoads
   sb    $21,0($20)
255
 
256
   ######################################
257
   #Branch and Jump Instructions
258
   ######################################
259
   ori   $2,$0,'B'
260
   sb    $2,0($20)
261
   ori   $2,$0,'r'
262
   sb    $2,0($20)
263
   ori   $2,$0,'a'
264
   sb    $2,0($20)
265
   ori   $2,$0,'n'
266
   sb    $2,0($20)
267
   ori   $2,$0,'c'
268
   sb    $2,0($20)
269
   ori   $2,$0,'h'
270
   sb    $2,0($20)
271
   sb    $21,0($20)
272
 
273 23 rhoads
   #a: B
274
   ori   $2,$0,'a'
275
   sb    $2,0($20)
276 15 rhoads
   ori   $10,$0,'A'
277
   ori   $11,$0,'B'
278
   b     $B1
279
   sb    $10,0($20)
280
   sb    $22,0($20)
281
$B1:
282
   sb    $11,0($20)
283
   sb    $21,0($20)
284
 
285 23 rhoads
   #b: BAL
286
   ori   $2,$0,'b'
287
   sb    $2,0($20)
288 15 rhoads
   ori   $10,$0,'A'
289
   ori   $11,$0,'B'
290
   ori   $12,$0,'C'
291
   ori   $13,$0,'D'
292
   ori   $14,$0,'E'
293
   ori   $15,$0,'X'
294
   bal   $BAL1
295
   sb    $10,0($20)
296
   sb    $13,0($20)
297
   b     $BAL2
298
   sb    $14,0($20)
299
   sb    $15,0($20)
300
$BAL1:
301
   sb    $11,0($20)
302
   jr    $31
303
   sb    $12,0($20)
304
   sb    $22,0($20)
305
$BAL2:
306
   sb    $21,0($20)
307
 
308 23 rhoads
   #c: BEQ
309
   ori   $2,$0,'c'
310
   sb    $2,0($20)
311 15 rhoads
   ori   $10,$0,'A'
312
   ori   $11,$0,'B'
313
   ori   $12,$0,'C'
314
   ori   $13,$0,'D'
315
   ori   $2,$0,100
316
   ori   $3,$0,123
317
   ori   $4,$0,123
318
   beq   $2,$3,$BEQ1
319
   sb    $10,0($20)
320
   sb    $11,0($20)
321
   beq   $3,$4,$BEQ1
322
   sb    $12,0($20)
323
   sb    $22,0($20)
324
$BEQ1:
325
   sb    $13,0($20)
326
   sb    $21,0($20)
327
 
328 23 rhoads
   #d: BGEZ
329
   ori   $2,$0,'d'
330
   sb    $2,0($20)
331 15 rhoads
   ori   $10,$0,'A'
332
   ori   $11,$0,'B'
333
   ori   $12,$0,'C'
334
   ori   $13,$0,'D'
335
   or    $15,$0,'X'
336
   ori   $2,$0,100
337
   li    $3,0xffff1234
338
   ori   $4,$0,123
339
   bgez  $3,$BGEZ1
340
   sb    $10,0($20)
341
   sb    $11,0($20)
342
   bgez  $2,$BGEZ1
343
   sb    $12,0($20)
344
   sb    $22,0($20)
345
$BGEZ1:
346
   bgez  $0,$BGEZ2
347
   nop
348
   sb    $15,0($20)
349
$BGEZ2:
350
   sb    $13,0($20)
351
   sb    $21,0($20)
352
 
353 23 rhoads
   #e: BGEZAL
354
   ori   $2,$0,'e'
355
   sb    $2,0($20)
356 15 rhoads
   ori   $10,$0,'A'
357
   ori   $11,$0,'B'
358
   ori   $12,$0,'C'
359
   ori   $13,$0,'D'
360
   ori   $14,$0,'E'
361
   ori   $15,$0,'X'
362
   li    $3,0xffff1234
363
   bgezal $3,$BGEZAL1
364
   nop
365
   sb    $10,0($20)
366
   bgezal $0,$BGEZAL1
367
   nop
368
   sb    $13,0($20)
369
   b     $BGEZAL2
370
   sb    $14,0($20)
371
   sb    $15,0($20)
372
$BGEZAL1:
373
   sb    $11,0($20)
374
   jr    $31
375
   sb    $12,0($20)
376
   sb    $22,0($20)
377
$BGEZAL2:
378
   sb    $21,0($20)
379
 
380 23 rhoads
   #f: BGTZ
381
   ori   $2,$0,'f'
382
   sb    $2,0($20)
383 15 rhoads
   ori   $10,$0,'A'
384
   ori   $11,$0,'B'
385
   ori   $12,$0,'C'
386
   ori   $13,$0,'D'
387
   ori   $2,$0,100
388
   li    $3,0xffff1234
389
   bgtz  $3,$BGTZ1
390
   sb    $10,0($20)
391
   sb    $11,0($20)
392
   bgtz  $2,$BGTZ1
393
   sb    $12,0($20)
394
   sb    $22,0($20)
395
$BGTZ1:
396
   sb    $13,0($20)
397
   sb    $21,0($20)
398
 
399 23 rhoads
   #g: BLEZ
400
   ori   $2,$0,'g'
401
   sb    $2,0($20)
402 15 rhoads
   ori   $10,$0,'A'
403
   ori   $11,$0,'B'
404
   ori   $12,$0,'C'
405
   ori   $13,$0,'D'
406
   ori   $2,$0,100
407
   li    $3,0xffff1234
408
   blez  $2,$BLEZ1
409
   sb    $10,0($20)
410
   sb    $11,0($20)
411
   blez  $3,$BLEZ1
412
   sb    $12,0($20)
413
   sb    $22,0($20)
414
$BLEZ1:
415
   blez  $0,$BLEZ2
416
   nop
417
   sb    $22,0($20)
418
$BLEZ2:
419
   sb    $13,0($20)
420
   sb    $21,0($20)
421
 
422 23 rhoads
   #h: BLTZ
423
   ori   $2,$0,'h'
424
   sb    $2,0($20)
425 15 rhoads
   ori   $10,$0,'A'
426
   ori   $11,$0,'B'
427
   ori   $12,$0,'C'
428
   ori   $13,$0,'D'
429
   ori   $14,$0,'E'
430
   ori   $2,$0,100
431
   li    $3,0xffff1234
432
   ori   $4,$0,0
433
   bltz  $2,$BLTZ1
434
   sb    $10,0($20)
435
   sb    $11,0($20)
436
   bltz  $3,$BLTZ1
437
   sb    $12,0($20)
438
   sb    $22,0($20)
439
$BLTZ1:
440
   bltz  $4,$BLTZ2
441
   nop
442
   sb    $13,0($20)
443
$BLTZ2:
444
   sb    $14,0($20)
445
   sb    $21,0($20)
446
 
447 23 rhoads
   #i: BLTZAL
448
   ori   $2,$0,'i'
449
   sb    $2,0($20)
450 15 rhoads
   ori   $10,$0,'A'
451
   ori   $11,$0,'B'
452
   ori   $12,$0,'C'
453
   ori   $13,$0,'D'
454
   ori   $14,$0,'E'
455
   ori   $15,$0,'X'
456
   li    $3,0xffff1234
457
   bltzal $0,$BLTZAL1
458
   nop
459
   sb    $10,0($20)
460
   bltzal $3,$BLTZAL1
461
   nop
462
   sb    $13,0($20)
463
   b     $BLTZAL2
464
   sb    $14,0($20)
465
   sb    $15,0($20)
466
$BLTZAL1:
467
   sb    $11,0($20)
468
   jr    $31
469
   sb    $12,0($20)
470
   sb    $22,0($20)
471
$BLTZAL2:
472
   sb    $21,0($20)
473
 
474 23 rhoads
   #j: BNE
475
   ori   $2,$0,'j'
476
   sb    $2,0($20)
477 15 rhoads
   ori   $10,$0,'A'
478
   ori   $11,$0,'B'
479
   ori   $12,$0,'C'
480
   ori   $13,$0,'D'
481
   ori   $2,$0,100
482
   ori   $3,$0,123
483
   ori   $4,$0,123
484
   bne   $3,$4,$BNE1
485
   sb    $10,0($20)
486
   sb    $11,0($20)
487
   bne   $2,$3,$BNE1
488
   sb    $12,0($20)
489
   sb    $22,0($20)
490
$BNE1:
491
   sb    $13,0($20)
492
   sb    $21,0($20)
493
 
494 23 rhoads
   #k: J
495
   ori   $2,$0,'k'
496
   sb    $2,0($20)
497 15 rhoads
   ori   $10,$0,'A'
498
   ori   $11,$0,'B'
499
   ori   $15,$0,'X'
500
   j     $J1
501
   sb    $10,0($20)
502
   sb    $15,0($20)
503
$J1:
504
   sb    $11,0($20)
505
   sb    $21,0($20)
506
 
507 23 rhoads
   #l: JAL
508
   ori   $2,$0,'l'
509
   sb    $2,0($20)
510 15 rhoads
   ori   $10,$0,'A'
511
   ori   $11,$0,'B'
512
   ori   $12,$0,'C'
513
   ori   $13,$0,'D'
514
   ori   $14,$0,'E'
515
   ori   $15,$0,'X'
516
   jal   $JAL1
517
   sb    $10,0($20)
518
   sb    $13,0($20)
519
   b     $JAL2
520
   sb    $14,0($20)
521
   sb    $15,0($20)
522
$JAL1:
523
   sb    $11,0($20)
524
   jr    $31
525
   sb    $12,0($20)
526
   sb    $22,0($20)
527
$JAL2:
528
   sb    $21,0($20)
529
 
530 23 rhoads
   #m: JALR
531
   ori   $2,$0,'m'
532
   sb    $2,0($20)
533 15 rhoads
   ori   $10,$0,'A'
534
   ori   $11,$0,'B'
535
   ori   $12,$0,'C'
536
   ori   $13,$0,'D'
537
   ori   $14,$0,'E'
538
   ori   $15,$0,'X'
539
   la    $3,$JALR1
540
   jalr  $3
541
   sb    $10,0($20)
542
   sb    $13,0($20)
543
   b     $JALR2
544
   sb    $14,0($20)
545
   sb    $15,0($20)
546
$JALR1:
547
   sb    $11,0($20)
548
   jr    $31
549
   sb    $12,0($20)
550
   sb    $22,0($20)
551
$JALR2:
552
   sb    $21,0($20)
553
 
554 23 rhoads
   #n: JR
555
   ori   $2,$0,'n'
556
   sb    $2,0($20)
557 15 rhoads
   ori   $10,$0,'A'
558
   ori   $11,$0,'B'
559
   ori   $15,$0,'X'
560
   la    $3,$JR1
561
   jr    $3
562
   sb    $10,0($20)
563
   sb    $15,0($20)
564
$JR1:
565
   sb    $11,0($20)
566
   sb    $21,0($20)
567
 
568 23 rhoads
   #o: NOP
569
   ori   $2,$0,'o'
570
   sb    $2,0($20)
571 15 rhoads
   ori   $2,$0,65
572
   nop
573
   sb    $2,0($20)
574
   sb    $21,0($20)
575
 
576
 
577
   ######################################
578
   #Load, Store, and Memory Control Instructions
579
   ######################################
580
   ori   $2,$0,'L'
581
   sb    $2,0($20)
582
   ori   $2,$0,'o'
583
   sb    $2,0($20)
584
   ori   $2,$0,'a'
585
   sb    $2,0($20)
586
   ori   $2,$0,'d'
587
   sb    $2,0($20)
588
   sb    $21,0($20)
589
 
590 23 rhoads
   #a: LB
591
   ori   $2,$0,'a'
592
   sb    $2,0($20)
593 15 rhoads
   ori   $2,$0,0xf000
594
   li    $3,0x41424344
595
   sw    $3,16($2)
596
   lb    $4,16($2)
597
   sb    $4,0($20)
598
   lb    $4,17($2)
599
   sb    $4,0($20)
600
   lb    $4,18($2)
601
   sb    $4,0($20)
602
   lb    $2,19($2)
603
   sb    $2,0($20)
604
   sb    $21,0($20)
605
 
606 23 rhoads
   #b: LBU
607
   ori   $2,$0,'b'
608
   sb    $2,0($20)
609 15 rhoads
   ori   $2,$0,0xf000
610
   li    $3,0x41424344
611
   sw    $3,16($2)
612
   lb    $4,16($2)
613
   sb    $4,0($20)
614
   lb    $4,17($2)
615
   sb    $4,0($20)
616
   lb    $4,18($2)
617
   sb    $4,0($20)
618
   lb    $2,19($2)
619
   sb    $2,0($20)
620
   sb    $21,0($20)
621
 
622 23 rhoads
   #c: LH
623
   ori   $2,$0,'c'
624
   sb    $2,0($20)
625 15 rhoads
   ori   $2,$0,0xf000
626
   li    $3,0x00410042
627
   sw    $3,16($2)
628
   lh    $4,16($2)
629
   sb    $4,0($20)
630
   lh    $2,18($2)
631
   sb    $2,0($20)
632
   sb    $21,0($20)
633
 
634 23 rhoads
   #d: LHU
635
   ori   $2,$0,'d'
636
   sb    $2,0($20)
637 15 rhoads
   ori   $2,$0,0xf000
638
   li    $3,0x00410042
639
   sw    $3,16($2)
640
   lh    $4,16($2)
641
   sb    $4,0($20)
642
   lh    $2,18($2)
643
   sb    $2,0($20)
644
   sb    $21,0($20)
645
 
646 23 rhoads
   #e: LW
647
   ori   $2,$0,'e'
648
   sb    $2,0($20)
649 15 rhoads
   ori   $2,$0,0xf000
650
   li    $3,'A'
651
   sw    $3,16($2)
652
   ori   $3,$0,0
653
   lw    $2,16($2)
654
   sb    $2,0($20)
655
   sb    $21,0($20)
656
 
657 23 rhoads
   #f: LWL & LWR
658
   ori   $2,$0,'f'
659
   sb    $2,0($20)
660 15 rhoads
   ori   $2,$0,0xf000
661
   li    $3,'A'
662
   sw    $3,16($2)
663
   ori   $3,$0,0
664
   lwl   $2,16($2)
665
   lwr   $2,16($2)
666
   sb    $2,0($20)
667
   sb    $21,0($20)
668
 
669 23 rhoads
   #g: SB
670
   ori   $2,$0,'g'
671
   sb    $2,0($20)
672 15 rhoads
   ori   $2,$0,'A'
673
   sb    $2,0($20)
674
   sb    $21,0($20)
675
 
676 23 rhoads
   #h: SH
677
   ori   $2,$0,'h'
678
   sb    $2,0($20)
679 29 rhoads
   ori   $4,$0,0xf000
680 15 rhoads
   ori   $2,$0,0x4142
681 29 rhoads
   sh    $2,16($4)
682
   lb    $3,16($4)
683 15 rhoads
   sb    $3,0($20)
684 29 rhoads
   lb    $2,17($4)
685 15 rhoads
   sb    $2,0($20)
686
   sb    $21,0($20)
687
 
688 23 rhoads
   #i: SW
689
   ori   $2,$0,'i'
690
   sb    $2,0($20)
691 15 rhoads
   ori   $2,$0,0xf000
692
   li    $3,0x41424344
693
   sw    $3,16($2)
694
   lb    $4,16($2)
695
   sb    $4,0($20)
696
   lb    $4,17($2)
697
   sb    $4,0($20)
698
   lb    $4,18($2)
699
   sb    $4,0($20)
700
   lb    $2,19($2)
701
   sb    $2,0($20)
702
   sb    $21,0($20)
703
 
704 23 rhoads
   #j: SWL & SWR
705
   ori   $2,$0,'j'
706
   sb    $2,0($20)
707 15 rhoads
   ori   $2,$0,0xf000
708
   li    $3,0x41424344
709
   swl   $3,16($2)
710
   swr   $3,16($2)
711
   lb    $4,16($2)
712
   sb    $4,0($20)
713
   lb    $4,17($2)
714
   sb    $4,0($20)
715
   lb    $4,18($2)
716
   sb    $4,0($20)
717
   lb    $2,19($2)
718
   sb    $2,0($20)
719
   sb    $21,0($20)
720
 
721
 
722
   ######################################
723
   #Logical Instructions
724
   ######################################
725
   ori   $2,$0,'L'
726
   sb    $2,0($20)
727
   ori   $2,$0,'o'
728
   sb    $2,0($20)
729
   ori   $2,$0,'g'
730
   sb    $2,0($20)
731
   ori   $2,$0,'i'
732
   sb    $2,0($20)
733
   ori   $2,$0,'c'
734
   sb    $2,0($20)
735
   sb    $21,0($20)
736
 
737 23 rhoads
   #a: AND
738
   ori   $2,$0,'a'
739
   sb    $2,0($20)
740 15 rhoads
   ori   $2,$0,0x0741
741
   ori   $3,$0,0x60f3
742
   and   $4,$2,$3
743
   sb    $4,0($20)
744
   sb    $21,0($20)
745
 
746 23 rhoads
   #b: ANDI
747
   ori   $2,$0,'b'
748
   sb    $2,0($20)
749 15 rhoads
   ori   $2,$0,0x0741
750
   andi  $4,$2,0x60f3
751
   sb    $4,0($20)
752
   sb    $21,0($20)
753
 
754 23 rhoads
   #c: LUI
755
   ori   $2,$0,'c'
756
   sb    $2,0($20)
757 15 rhoads
   lui   $2,0x41
758
   srl   $3,$2,16
759
   sb    $3,0($20)
760
   sb    $21,0($20)
761
 
762 23 rhoads
   #d: NOR
763
   ori   $2,$0,'d'
764
   sb    $2,0($20)
765 15 rhoads
   li    $2,0xf0fff08e
766
   li    $3,0x0f0f0f30
767
   nor   $4,$2,$3
768
   sb    $4,0($20)
769
   sb    $21,0($20)
770
 
771 23 rhoads
   #e: OR
772
   ori   $2,$0,'e'
773
   sb    $2,0($20)
774 15 rhoads
   ori   $2,$0,0x40
775
   ori   $3,$0,0x01
776
   or    $4,$2,$3
777
   sb    $4,0($20)
778
   sb    $21,0($20)
779
 
780 23 rhoads
   #f: ORI
781
   ori   $2,$0,'f'
782
   sb    $2,0($20)
783 15 rhoads
   ori   $2,$0,0x40
784
   ori   $4,$2,0x01
785
   sb    $4,0($20)
786
   sb    $21,0($20)
787
 
788 23 rhoads
   #g: XOR
789
   ori   $2,$0,'g'
790
   sb    $2,0($20)
791 15 rhoads
   ori   $2,$0,0xf043
792
   ori   $3,$0,0xf002
793
   xor   $4,$2,$3
794
   sb    $4,0($20)
795
   sb    $21,0($20)
796
 
797 23 rhoads
   #h: XORI
798
   ori   $2,$0,'h'
799
   sb    $2,0($20)
800 15 rhoads
   ori   $2,$0,0xf043
801
   xor   $4,$2,0xf002
802
   sb    $4,0($20)
803
   sb    $21,0($20)
804
 
805
 
806
   ######################################
807
   #Move Instructions
808
   ######################################
809
   ori   $2,$0,'M'
810
   sb    $2,0($20)
811
   ori   $2,$0,'o'
812
   sb    $2,0($20)
813
   ori   $2,$0,'v'
814
   sb    $2,0($20)
815
   ori   $2,$0,'e'
816
   sb    $2,0($20)
817
   sb    $21,0($20)
818
 
819 23 rhoads
   #a: MFHI
820
   ori   $2,$0,'a'
821
   sb    $2,0($20)
822 15 rhoads
   ori   $2,$0,65
823
   mthi  $2
824
   mfhi  $3
825
   sb    $3,0($20)
826
   sb    $21,0($20)
827
 
828 23 rhoads
   #b: MFLO
829
   ori   $2,$0,'b'
830
   sb    $2,0($20)
831 15 rhoads
   ori   $2,$0,65
832
   mtlo  $2
833
   mflo  $3
834
   sb    $3,0($20)
835
   sb    $21,0($20)
836
 
837 23 rhoads
   #c: MTHI
838
   ori   $2,$0,'c'
839
   sb    $2,0($20)
840 15 rhoads
   ori   $2,$0,65
841
   mthi  $2
842
   mfhi  $3
843
   sb    $3,0($20)
844
   sb    $21,0($20)
845
 
846 23 rhoads
   #d: MTLO
847
   ori   $2,$0,'d'
848
   sb    $2,0($20)
849 15 rhoads
   ori   $2,$0,65
850
   mtlo  $2
851
   mflo  $3
852
   sb    $3,0($20)
853
   sb    $21,0($20)
854
 
855
 
856
   ######################################
857
   #Shift Instructions
858
   ######################################
859
   ori   $2,$0,'S'
860
   sb    $2,0($20)
861
   ori   $2,$0,'h'
862
   sb    $2,0($20)
863
   ori   $2,$0,'i'
864
   sb    $2,0($20)
865
   ori   $2,$0,'f'
866
   sb    $2,0($20)
867
   ori   $2,$0,'t'
868
   sb    $2,0($20)
869
   sb    $21,0($20)
870
 
871 23 rhoads
   #a: SLL
872
   ori   $2,$0,'a'
873
   sb    $2,0($20)
874 15 rhoads
   li    $2,0x40414243
875
   sll   $3,$2,8
876
   srl   $3,$3,24
877
   sb    $3,0($20)
878
   sb    $21,0($20)
879
 
880 23 rhoads
   #b: SLLV
881
   ori   $2,$0,'b'
882
   sb    $2,0($20)
883 15 rhoads
   li    $2,0x40414243
884
   ori   $3,$0,8
885
   sllv  $3,$2,$3
886
   srl   $3,$3,24
887
   sb    $3,0($20)
888
   sb    $21,0($20)
889
 
890 23 rhoads
   #c: SRA
891
   ori   $2,$0,'c'
892
   sb    $2,0($20)
893 15 rhoads
   li    $2,0x40414243
894
   sra   $3,$2,16
895
   sb    $3,0($20)
896
   li    $2,0x84000000
897
   sra   $3,$2,25
898
   sub   $3,$3,0x80
899
   sb    $3,0($20)
900
   sb    $21,0($20)
901
 
902 23 rhoads
   #d: SRAV
903
   ori   $2,$0,'d'
904
   sb    $2,0($20)
905 15 rhoads
   li    $2,0x40414243
906
   ori   $3,$0,16
907
   srav  $3,$2,$3
908
   sb    $3,0($20)
909
   ori   $3,$0,25
910
   li    $2,0x84000000
911 29 rhoads
   srav  $3,$2,$3
912 15 rhoads
   sub   $3,$3,0x80
913
   sb    $3,0($20)
914
   sb    $21,0($20)
915
 
916 23 rhoads
   #e: SRL
917
   ori   $2,$0,'e'
918
   sb    $2,0($20)
919 15 rhoads
   li    $2,0x40414243
920
   srl   $3,$2,16
921
   sb    $3,0($20)
922
   li    $2,0x84000000
923 29 rhoads
   srl   $3,$2,25
924 15 rhoads
   sb    $3,0($20)
925
   sb    $21,0($20)
926
 
927 23 rhoads
   #f: SRLV
928
   ori   $2,$0,'f'
929
   sb    $2,0($20)
930 15 rhoads
   li    $2,0x40414243
931
   ori   $3,$0,16
932
   srlv  $4,$2,$3
933
   sb    $4,0($20)
934
   ori   $3,$0,25
935
   li    $2,0x84000000
936 29 rhoads
   srlv  $3,$2,$3
937 15 rhoads
   sb    $3,0($20)
938
   sb    $21,0($20)
939
 
940
 
941
   ori   $2,$0,'D'
942
   sb    $2,0($20)
943
   ori   $2,$0,'o'
944
   sb    $2,0($20)
945
   ori   $2,$0,'n'
946
   sb    $2,0($20)
947
   ori   $2,$0,'e'
948
   sb    $2,0($20)
949
   sb    $21,0($20)
950
 
951
 
952
$DONE:
953
   j     $DONE
954
   nop
955
 
956
   .set reorder
957
        .end    entry
958
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.