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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [tools/] [opcodes.asm] - Blame information for rev 378

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

powered by: WebSVN 2.1.0

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