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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [hwtests/] [xcptest/] [start.s] - Blame information for rev 72

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

Line No. Rev Author Line
1 14 hellwig
;
2
; start.s -- startup and support routines
3
;
4
 
5
        .set    dmapaddr,0xC0000000     ; base of directly mapped addresses
6
        .set    stacktop,0xC0400000     ; monitor stack is at top of memory
7
 
8
        .set    PSW,0                    ; reg # of PSW
9
        .set    TLB_INDEX,1             ; reg # of TLB Index
10
        .set    TLB_ENTRY_HI,2          ; reg # of TLB EntryHi
11
        .set    TLB_ENTRY_LO,3          ; reg # of TLB EntryLo
12
        .set    TLB_ENTRIES,32          ; number of TLB entries
13
 
14
;***************************************************************
15
 
16
        .import _ecode
17
        .import _edata
18
        .import _ebss
19
 
20
        .import serinit
21
        .import ser0in
22
        .import ser0out
23
 
24
        .import main
25
        .import userMissTaken
26
 
27
        .export _bcode
28
        .export _bdata
29
        .export _bbss
30
 
31
        .export cin
32
        .export cout
33
 
34
        .export xtest1
35
        .export xtest1x
36
        .export xtest2
37
        .export xtest2x
38
        .export xtest3
39
        .export xtest3x
40
        .export xtest4
41
        .export xtest4x
42
        .export xtest5
43
        .export xtest5x
44
        .export xtest6
45
        .export xtest6x
46
        .export xtest7
47
        .export xtest7x
48
        .export xtest8
49
        .export xtest8x
50
        .export xtest9
51
        .export xtest9x
52
        .export xtest10
53
        .export xtest10x
54
        .export xtest11
55
        .export xtest11x
56
        .export xtest12
57
        .export xtest12x
58
        .export xtest13
59
        .export xtest13x
60
        .export xtest14
61
        .export xtest14x
62
        .export xtest15
63
        .export xtest15x
64
        .export xtest16
65
        .export xtest16x
66
        .export xtest17
67
        .export xtest17x
68
        .export xtest18
69
        .export xtest18x
70
        .export xtest19
71
        .export xtest19x
72
        .export xtest20
73
        .export xtest20x
74
        .export xtest21
75
        .export xtest21x
76
        .export xtest22
77
        .export xtest22x
78
        .export xtest23
79
        .export xtest23x
80
        .export xtest24
81
        .export xtest24x
82
        .export xtest25
83
        .export xtest25x
84
        .export xtest26
85
        .export xtest26x
86
        .export xtest27
87
        .export xtest27x
88
        .export xtest28
89
        .export xtest28x
90
        .export xtest29
91
        .export xtest29x
92
        .export xtest30
93
        .export xtest30x
94
        .export xtest31
95
        .export xtest31x
96
        .export xtest32
97
        .export xtest32x
98
        .export xtest33
99
        .export xtest33x
100
        .export xtest34
101
        .export xtest34x
102
        .export xtest35
103
        .export xtest35x
104
        .export xtest36
105
        .export xtest36x
106
        .export xtest37
107
        .export xtest37x
108
 
109
        .export getTLB_HI
110
        .export getTLB_LO
111
        .export setTLB
112
 
113
;***************************************************************
114
 
115
        .code
116
_bcode:
117
 
118
        .data
119
_bdata:
120
 
121
        .bss
122
_bbss:
123
 
124
;***************************************************************
125
 
126
        .code
127
        .align  4
128
 
129
reset:
130
        j       start
131
 
132
interrupt:
133
        j       isr
134
 
135
userMiss:
136
        j       umsr
137
 
138
;***************************************************************
139
 
140
        .code
141
        .align  4
142
 
143
cin:
144
        j       ser0in
145
 
146
cout:
147
        j       ser0out
148
 
149
;***************************************************************
150
 
151
        .code
152
        .align  4
153
 
154
start:
155
        ; force CPU into a defined state
156
        mvts    $0,PSW                   ; disable interrupts and user mode
157
 
158
        ; initialize TLB
159
        mvts    $0,TLB_ENTRY_LO          ; invalidate all TLB entries
160
        add     $8,$0,dmapaddr           ; by impossible virtual page number
161
        add     $9,$0,$0
162
        add     $10,$0,TLB_ENTRIES
163
tlbloop:
164
        mvts    $8,TLB_ENTRY_HI
165
        mvts    $9,TLB_INDEX
166
        tbwi
167
        add     $8,$8,0x1000            ; all entries must be different
168
        add     $9,$9,1
169
        bne     $9,$10,tlbloop
170
 
171
        ; copy data segment
172
        add     $10,$0,_bdata            ; lowest dst addr to be written to
173
        add     $8,$0,_edata             ; one above the top dst addr
174
        sub     $9,$8,$10               ; $9 = size of data segment
175
        add     $9,$9,_ecode            ; data is waiting right after code
176
        j       cpytest
177
cpyloop:
178
        ldw     $11,$9,0         ; src addr in $9
179
        stw     $11,$8,0         ; dst addr in $8
180
cpytest:
181
        sub     $8,$8,4                 ; downward
182
        sub     $9,$9,4
183
        bgeu    $8,$10,cpyloop
184
 
185
        ; clear bss segment
186
        add     $8,$0,_bbss              ; start with first word of bss
187
        add     $9,$0,_ebss              ; this is one above the top
188
        j       clrtest
189
clrloop:
190
        stw     $0,$8,0                   ; dst addr in $8
191
        add     $8,$8,4                 ; upward
192
clrtest:
193
        bltu    $8,$9,clrloop
194
 
195
        ; now do some useful work
196
        add     $29,$0,stacktop          ; setup monitor stack
197
        jal     serinit                 ; init serial interface
198
        jal     main                    ; enter command loop
199
 
200
        ; main should never return
201
        j       start                   ; just to be sure...
202
 
203
;***************************************************************
204
 
205
xtest1:
206
        mvts    $0,PSW
207
        add     $8,$0,returnState
208
        stw     $4,$8,0*4                ; pointer to interrupt context
209
        stw     $31,$8,1*4              ; return address
210
        stw     $29,$8,2*4              ; stack pointer
211
        stw     $16,$8,3*4              ; local variables
212
        stw     $17,$8,4*4
213
        stw     $18,$8,5*4
214
        stw     $19,$8,6*4
215
        stw     $20,$8,7*4
216
        stw     $21,$8,8*4
217
        stw     $22,$8,9*4
218
        stw     $23,$8,10*4
219
        .nosyn
220
        add     $28,$4,$0
221
        ldw     $8,$28,33*4             ; tlbIndex
222
        mvts    $8,TLB_INDEX
223
        ldw     $8,$28,34*4             ; tlbWntryHi
224
        mvts    $8,TLB_ENTRY_HI
225
        ldw     $8,$28,35*4             ; tlbEntryLo
226
        mvts    $8,TLB_ENTRY_LO
227
        ;ldw    $0,$28,0*4              ; registers
228
        ldw     $1,$28,1*4
229
        ldw     $2,$28,2*4
230
        ldw     $3,$28,3*4
231
        ldw     $4,$28,4*4
232
        ldw     $5,$28,5*4
233
        ldw     $6,$28,6*4
234
        ldw     $7,$28,7*4
235
        ldw     $8,$28,8*4
236
        ldw     $9,$28,9*4
237
        ldw     $10,$28,10*4
238
        ldw     $11,$28,11*4
239
        ldw     $12,$28,12*4
240
        ldw     $13,$28,13*4
241
        ldw     $14,$28,14*4
242
        ldw     $15,$28,15*4
243
        ldw     $16,$28,16*4
244
        ldw     $17,$28,17*4
245
        ldw     $18,$28,18*4
246
        ldw     $19,$28,19*4
247
        ldw     $20,$28,20*4
248
        ldw     $21,$28,21*4
249
        ldw     $22,$28,22*4
250
        ldw     $23,$28,23*4
251
        ldw     $24,$28,24*4
252
        ldw     $25,$28,25*4
253
        ldw     $26,$28,26*4
254
        ldw     $27,$28,27*4
255
        ;ldw    $28,$28,28*4
256
        ldw     $29,$28,29*4
257
        ldw     $30,$28,30*4
258
        ldw     $31,$28,31*4
259
        ldw     $28,$28,32*4            ; psw
260
        mvts    $28,PSW
261
xtest1x:
262
        trap
263
        j       halt
264
        .syn
265
 
266
xtest2:
267
        mvts    $0,PSW
268
        add     $8,$0,returnState
269
        stw     $4,$8,0*4                ; pointer to interrupt context
270
        stw     $31,$8,1*4              ; return address
271
        stw     $29,$8,2*4              ; stack pointer
272
        stw     $16,$8,3*4              ; local variables
273
        stw     $17,$8,4*4
274
        stw     $18,$8,5*4
275
        stw     $19,$8,6*4
276
        stw     $20,$8,7*4
277
        stw     $21,$8,8*4
278
        stw     $22,$8,9*4
279
        stw     $23,$8,10*4
280
        .nosyn
281
        add     $28,$4,$0
282
        ldw     $8,$28,33*4             ; tlbIndex
283
        mvts    $8,TLB_INDEX
284
        ldw     $8,$28,34*4             ; tlbWntryHi
285
        mvts    $8,TLB_ENTRY_HI
286
        ldw     $8,$28,35*4             ; tlbEntryLo
287
        mvts    $8,TLB_ENTRY_LO
288
        ;ldw    $0,$28,0*4              ; registers
289
        ldw     $1,$28,1*4
290
        ldw     $2,$28,2*4
291
        ldw     $3,$28,3*4
292
        ldw     $4,$28,4*4
293
        ldw     $5,$28,5*4
294
        ldw     $6,$28,6*4
295
        ldw     $7,$28,7*4
296
        ldw     $8,$28,8*4
297
        ldw     $9,$28,9*4
298
        ldw     $10,$28,10*4
299
        ldw     $11,$28,11*4
300
        ldw     $12,$28,12*4
301
        ldw     $13,$28,13*4
302
        ldw     $14,$28,14*4
303
        ldw     $15,$28,15*4
304
        ldw     $16,$28,16*4
305
        ldw     $17,$28,17*4
306
        ldw     $18,$28,18*4
307
        ldw     $19,$28,19*4
308
        ldw     $20,$28,20*4
309
        ldw     $21,$28,21*4
310
        ldw     $22,$28,22*4
311
        ldw     $23,$28,23*4
312
        ldw     $24,$28,24*4
313
        ldw     $25,$28,25*4
314
        ldw     $26,$28,26*4
315
        ldw     $27,$28,27*4
316
        ;ldw    $28,$28,28*4
317
        ldw     $29,$28,29*4
318
        ldw     $30,$28,30*4
319
        ldw     $31,$28,31*4
320
        ldw     $28,$28,32*4            ; psw
321
        mvts    $28,PSW
322
xtest2x:
323
        .word   0x1E << 26
324
        j       halt
325
        .syn
326
 
327
xtest3:
328
        mvts    $0,PSW
329
        add     $8,$0,returnState
330
        stw     $4,$8,0*4                ; pointer to interrupt context
331
        stw     $31,$8,1*4              ; return address
332
        stw     $29,$8,2*4              ; stack pointer
333
        stw     $16,$8,3*4              ; local variables
334
        stw     $17,$8,4*4
335
        stw     $18,$8,5*4
336
        stw     $19,$8,6*4
337
        stw     $20,$8,7*4
338
        stw     $21,$8,8*4
339
        stw     $22,$8,9*4
340
        stw     $23,$8,10*4
341
        .nosyn
342
        add     $28,$4,$0
343
        ldw     $8,$28,33*4             ; tlbIndex
344
        mvts    $8,TLB_INDEX
345
        ldw     $8,$28,34*4             ; tlbWntryHi
346
        mvts    $8,TLB_ENTRY_HI
347
        ldw     $8,$28,35*4             ; tlbEntryLo
348
        mvts    $8,TLB_ENTRY_LO
349
        ;ldw    $0,$28,0*4              ; registers
350
        ldw     $1,$28,1*4
351
        ldw     $2,$28,2*4
352
        ldw     $3,$28,3*4
353
        ldw     $4,$28,4*4
354
        ldw     $5,$28,5*4
355
        ldw     $6,$28,6*4
356
        ldw     $7,$28,7*4
357
        ldw     $8,$28,8*4
358
        ldw     $9,$28,9*4
359
        ldw     $10,$28,10*4
360
        ldw     $11,$28,11*4
361
        ldw     $12,$28,12*4
362
        ldw     $13,$28,13*4
363
        ldw     $14,$28,14*4
364
        ldw     $15,$28,15*4
365
        ldw     $16,$28,16*4
366
        ldw     $17,$28,17*4
367
        ldw     $18,$28,18*4
368
        ldw     $19,$28,19*4
369
        ldw     $20,$28,20*4
370
        ldw     $21,$28,21*4
371
        ldw     $22,$28,22*4
372
        ldw     $23,$28,23*4
373
        ldw     $24,$28,24*4
374
        ldw     $25,$28,25*4
375
        ldw     $26,$28,26*4
376
        ldw     $27,$28,27*4
377
        ;ldw    $28,$28,28*4
378
        ldw     $29,$28,29*4
379
        ldw     $30,$28,30*4
380
        ldw     $31,$28,31*4
381
        ldw     $28,$28,32*4            ; psw
382
        mvts    $28,PSW
383
xtest3x:
384
        div     $5,$7,$0
385
        j       halt
386
        .syn
387
 
388
xtest4:
389
        mvts    $0,PSW
390
        add     $8,$0,returnState
391
        stw     $4,$8,0*4                ; pointer to interrupt context
392
        stw     $31,$8,1*4              ; return address
393
        stw     $29,$8,2*4              ; stack pointer
394
        stw     $16,$8,3*4              ; local variables
395
        stw     $17,$8,4*4
396
        stw     $18,$8,5*4
397
        stw     $19,$8,6*4
398
        stw     $20,$8,7*4
399
        stw     $21,$8,8*4
400
        stw     $22,$8,9*4
401
        stw     $23,$8,10*4
402
        .nosyn
403
        add     $28,$4,$0
404
        ldw     $8,$28,33*4             ; tlbIndex
405
        mvts    $8,TLB_INDEX
406
        ldw     $8,$28,34*4             ; tlbWntryHi
407
        mvts    $8,TLB_ENTRY_HI
408
        ldw     $8,$28,35*4             ; tlbEntryLo
409
        mvts    $8,TLB_ENTRY_LO
410
        ;ldw    $0,$28,0*4              ; registers
411
        ldw     $1,$28,1*4
412
        ldw     $2,$28,2*4
413
        ldw     $3,$28,3*4
414
        ldw     $4,$28,4*4
415
        ldw     $5,$28,5*4
416
        ldw     $6,$28,6*4
417
        ldw     $7,$28,7*4
418
        ldw     $8,$28,8*4
419
        ldw     $9,$28,9*4
420
        ldw     $10,$28,10*4
421
        ldw     $11,$28,11*4
422
        ldw     $12,$28,12*4
423
        ldw     $13,$28,13*4
424
        ldw     $14,$28,14*4
425
        ldw     $15,$28,15*4
426
        ldw     $16,$28,16*4
427
        ldw     $17,$28,17*4
428
        ldw     $18,$28,18*4
429
        ldw     $19,$28,19*4
430
        ldw     $20,$28,20*4
431
        ldw     $21,$28,21*4
432
        ldw     $22,$28,22*4
433
        ldw     $23,$28,23*4
434
        ldw     $24,$28,24*4
435
        ldw     $25,$28,25*4
436
        ldw     $26,$28,26*4
437
        ldw     $27,$28,27*4
438
        ;ldw    $28,$28,28*4
439
        ldw     $29,$28,29*4
440
        ldw     $30,$28,30*4
441
        ldw     $31,$28,31*4
442
        ldw     $28,$28,32*4            ; psw
443
        mvts    $28,PSW
444
xtest4x:
445
        div     $5,$7,0
446
        j       halt
447
        .syn
448
 
449
xtest5:
450
        mvts    $0,PSW
451
        add     $8,$0,returnState
452
        stw     $4,$8,0*4                ; pointer to interrupt context
453
        stw     $31,$8,1*4              ; return address
454
        stw     $29,$8,2*4              ; stack pointer
455
        stw     $16,$8,3*4              ; local variables
456
        stw     $17,$8,4*4
457
        stw     $18,$8,5*4
458
        stw     $19,$8,6*4
459
        stw     $20,$8,7*4
460
        stw     $21,$8,8*4
461
        stw     $22,$8,9*4
462
        stw     $23,$8,10*4
463
        .nosyn
464
        add     $28,$4,$0
465
        ldw     $8,$28,33*4             ; tlbIndex
466
        mvts    $8,TLB_INDEX
467
        ldw     $8,$28,34*4             ; tlbWntryHi
468
        mvts    $8,TLB_ENTRY_HI
469
        ldw     $8,$28,35*4             ; tlbEntryLo
470
        mvts    $8,TLB_ENTRY_LO
471
        ;ldw    $0,$28,0*4              ; registers
472
        ldw     $1,$28,1*4
473
        ldw     $2,$28,2*4
474
        ldw     $3,$28,3*4
475
        ldw     $4,$28,4*4
476
        ldw     $5,$28,5*4
477
        ldw     $6,$28,6*4
478
        ldw     $7,$28,7*4
479
        ldw     $8,$28,8*4
480
        ldw     $9,$28,9*4
481
        ldw     $10,$28,10*4
482
        ldw     $11,$28,11*4
483
        ldw     $12,$28,12*4
484
        ldw     $13,$28,13*4
485
        ldw     $14,$28,14*4
486
        ldw     $15,$28,15*4
487
        ldw     $16,$28,16*4
488
        ldw     $17,$28,17*4
489
        ldw     $18,$28,18*4
490
        ldw     $19,$28,19*4
491
        ldw     $20,$28,20*4
492
        ldw     $21,$28,21*4
493
        ldw     $22,$28,22*4
494
        ldw     $23,$28,23*4
495
        ldw     $24,$28,24*4
496
        ldw     $25,$28,25*4
497
        ldw     $26,$28,26*4
498
        ldw     $27,$28,27*4
499
        ;ldw    $28,$28,28*4
500
        ldw     $29,$28,29*4
501
        ldw     $30,$28,30*4
502
        ldw     $31,$28,31*4
503
        ldw     $28,$28,32*4            ; psw
504
        mvts    $28,PSW
505
xtest5x:
506
        divu    $5,$7,$0
507
        j       halt
508
        .syn
509
 
510
xtest6:
511
        mvts    $0,PSW
512
        add     $8,$0,returnState
513
        stw     $4,$8,0*4                ; pointer to interrupt context
514
        stw     $31,$8,1*4              ; return address
515
        stw     $29,$8,2*4              ; stack pointer
516
        stw     $16,$8,3*4              ; local variables
517
        stw     $17,$8,4*4
518
        stw     $18,$8,5*4
519
        stw     $19,$8,6*4
520
        stw     $20,$8,7*4
521
        stw     $21,$8,8*4
522
        stw     $22,$8,9*4
523
        stw     $23,$8,10*4
524
        .nosyn
525
        add     $28,$4,$0
526
        ldw     $8,$28,33*4             ; tlbIndex
527
        mvts    $8,TLB_INDEX
528
        ldw     $8,$28,34*4             ; tlbWntryHi
529
        mvts    $8,TLB_ENTRY_HI
530
        ldw     $8,$28,35*4             ; tlbEntryLo
531
        mvts    $8,TLB_ENTRY_LO
532
        ;ldw    $0,$28,0*4              ; registers
533
        ldw     $1,$28,1*4
534
        ldw     $2,$28,2*4
535
        ldw     $3,$28,3*4
536
        ldw     $4,$28,4*4
537
        ldw     $5,$28,5*4
538
        ldw     $6,$28,6*4
539
        ldw     $7,$28,7*4
540
        ldw     $8,$28,8*4
541
        ldw     $9,$28,9*4
542
        ldw     $10,$28,10*4
543
        ldw     $11,$28,11*4
544
        ldw     $12,$28,12*4
545
        ldw     $13,$28,13*4
546
        ldw     $14,$28,14*4
547
        ldw     $15,$28,15*4
548
        ldw     $16,$28,16*4
549
        ldw     $17,$28,17*4
550
        ldw     $18,$28,18*4
551
        ldw     $19,$28,19*4
552
        ldw     $20,$28,20*4
553
        ldw     $21,$28,21*4
554
        ldw     $22,$28,22*4
555
        ldw     $23,$28,23*4
556
        ldw     $24,$28,24*4
557
        ldw     $25,$28,25*4
558
        ldw     $26,$28,26*4
559
        ldw     $27,$28,27*4
560
        ;ldw    $28,$28,28*4
561
        ldw     $29,$28,29*4
562
        ldw     $30,$28,30*4
563
        ldw     $31,$28,31*4
564
        ldw     $28,$28,32*4            ; psw
565
        mvts    $28,PSW
566
xtest6x:
567
        divu    $5,$7,0
568
        j       halt
569
        .syn
570
 
571
xtest7:
572
        mvts    $0,PSW
573
        add     $8,$0,returnState
574
        stw     $4,$8,0*4                ; pointer to interrupt context
575
        stw     $31,$8,1*4              ; return address
576
        stw     $29,$8,2*4              ; stack pointer
577
        stw     $16,$8,3*4              ; local variables
578
        stw     $17,$8,4*4
579
        stw     $18,$8,5*4
580
        stw     $19,$8,6*4
581
        stw     $20,$8,7*4
582
        stw     $21,$8,8*4
583
        stw     $22,$8,9*4
584
        stw     $23,$8,10*4
585
        .nosyn
586
        add     $28,$4,$0
587
        ldw     $8,$28,33*4             ; tlbIndex
588
        mvts    $8,TLB_INDEX
589
        ldw     $8,$28,34*4             ; tlbWntryHi
590
        mvts    $8,TLB_ENTRY_HI
591
        ldw     $8,$28,35*4             ; tlbEntryLo
592
        mvts    $8,TLB_ENTRY_LO
593
        ;ldw    $0,$28,0*4              ; registers
594
        ldw     $1,$28,1*4
595
        ldw     $2,$28,2*4
596
        ldw     $3,$28,3*4
597
        ldw     $4,$28,4*4
598
        ldw     $5,$28,5*4
599
        ldw     $6,$28,6*4
600
        ldw     $7,$28,7*4
601
        ldw     $8,$28,8*4
602
        ldw     $9,$28,9*4
603
        ldw     $10,$28,10*4
604
        ldw     $11,$28,11*4
605
        ldw     $12,$28,12*4
606
        ldw     $13,$28,13*4
607
        ldw     $14,$28,14*4
608
        ldw     $15,$28,15*4
609
        ldw     $16,$28,16*4
610
        ldw     $17,$28,17*4
611
        ldw     $18,$28,18*4
612
        ldw     $19,$28,19*4
613
        ldw     $20,$28,20*4
614
        ldw     $21,$28,21*4
615
        ldw     $22,$28,22*4
616
        ldw     $23,$28,23*4
617
        ldw     $24,$28,24*4
618
        ldw     $25,$28,25*4
619
        ldw     $26,$28,26*4
620
        ldw     $27,$28,27*4
621
        ;ldw    $28,$28,28*4
622
        ldw     $29,$28,29*4
623
        ldw     $30,$28,30*4
624
        ldw     $31,$28,31*4
625
        ldw     $28,$28,32*4            ; psw
626
        mvts    $28,PSW
627
xtest7x:
628
        rem     $5,$7,$0
629
        j       halt
630
        .syn
631
 
632
xtest8:
633
        mvts    $0,PSW
634
        add     $8,$0,returnState
635
        stw     $4,$8,0*4                ; pointer to interrupt context
636
        stw     $31,$8,1*4              ; return address
637
        stw     $29,$8,2*4              ; stack pointer
638
        stw     $16,$8,3*4              ; local variables
639
        stw     $17,$8,4*4
640
        stw     $18,$8,5*4
641
        stw     $19,$8,6*4
642
        stw     $20,$8,7*4
643
        stw     $21,$8,8*4
644
        stw     $22,$8,9*4
645
        stw     $23,$8,10*4
646
        .nosyn
647
        add     $28,$4,$0
648
        ldw     $8,$28,33*4             ; tlbIndex
649
        mvts    $8,TLB_INDEX
650
        ldw     $8,$28,34*4             ; tlbWntryHi
651
        mvts    $8,TLB_ENTRY_HI
652
        ldw     $8,$28,35*4             ; tlbEntryLo
653
        mvts    $8,TLB_ENTRY_LO
654
        ;ldw    $0,$28,0*4              ; registers
655
        ldw     $1,$28,1*4
656
        ldw     $2,$28,2*4
657
        ldw     $3,$28,3*4
658
        ldw     $4,$28,4*4
659
        ldw     $5,$28,5*4
660
        ldw     $6,$28,6*4
661
        ldw     $7,$28,7*4
662
        ldw     $8,$28,8*4
663
        ldw     $9,$28,9*4
664
        ldw     $10,$28,10*4
665
        ldw     $11,$28,11*4
666
        ldw     $12,$28,12*4
667
        ldw     $13,$28,13*4
668
        ldw     $14,$28,14*4
669
        ldw     $15,$28,15*4
670
        ldw     $16,$28,16*4
671
        ldw     $17,$28,17*4
672
        ldw     $18,$28,18*4
673
        ldw     $19,$28,19*4
674
        ldw     $20,$28,20*4
675
        ldw     $21,$28,21*4
676
        ldw     $22,$28,22*4
677
        ldw     $23,$28,23*4
678
        ldw     $24,$28,24*4
679
        ldw     $25,$28,25*4
680
        ldw     $26,$28,26*4
681
        ldw     $27,$28,27*4
682
        ;ldw    $28,$28,28*4
683
        ldw     $29,$28,29*4
684
        ldw     $30,$28,30*4
685
        ldw     $31,$28,31*4
686
        ldw     $28,$28,32*4            ; psw
687
        mvts    $28,PSW
688
xtest8x:
689
        rem     $5,$7,0
690
        j       halt
691
        .syn
692
 
693
xtest9:
694
        mvts    $0,PSW
695
        add     $8,$0,returnState
696
        stw     $4,$8,0*4                ; pointer to interrupt context
697
        stw     $31,$8,1*4              ; return address
698
        stw     $29,$8,2*4              ; stack pointer
699
        stw     $16,$8,3*4              ; local variables
700
        stw     $17,$8,4*4
701
        stw     $18,$8,5*4
702
        stw     $19,$8,6*4
703
        stw     $20,$8,7*4
704
        stw     $21,$8,8*4
705
        stw     $22,$8,9*4
706
        stw     $23,$8,10*4
707
        .nosyn
708
        add     $28,$4,$0
709
        ldw     $8,$28,33*4             ; tlbIndex
710
        mvts    $8,TLB_INDEX
711
        ldw     $8,$28,34*4             ; tlbWntryHi
712
        mvts    $8,TLB_ENTRY_HI
713
        ldw     $8,$28,35*4             ; tlbEntryLo
714
        mvts    $8,TLB_ENTRY_LO
715
        ;ldw    $0,$28,0*4              ; registers
716
        ldw     $1,$28,1*4
717
        ldw     $2,$28,2*4
718
        ldw     $3,$28,3*4
719
        ldw     $4,$28,4*4
720
        ldw     $5,$28,5*4
721
        ldw     $6,$28,6*4
722
        ldw     $7,$28,7*4
723
        ldw     $8,$28,8*4
724
        ldw     $9,$28,9*4
725
        ldw     $10,$28,10*4
726
        ldw     $11,$28,11*4
727
        ldw     $12,$28,12*4
728
        ldw     $13,$28,13*4
729
        ldw     $14,$28,14*4
730
        ldw     $15,$28,15*4
731
        ldw     $16,$28,16*4
732
        ldw     $17,$28,17*4
733
        ldw     $18,$28,18*4
734
        ldw     $19,$28,19*4
735
        ldw     $20,$28,20*4
736
        ldw     $21,$28,21*4
737
        ldw     $22,$28,22*4
738
        ldw     $23,$28,23*4
739
        ldw     $24,$28,24*4
740
        ldw     $25,$28,25*4
741
        ldw     $26,$28,26*4
742
        ldw     $27,$28,27*4
743
        ;ldw    $28,$28,28*4
744
        ldw     $29,$28,29*4
745
        ldw     $30,$28,30*4
746
        ldw     $31,$28,31*4
747
        ldw     $28,$28,32*4            ; psw
748
        mvts    $28,PSW
749
xtest9x:
750
        remu    $5,$7,$0
751
        j       halt
752
        .syn
753
 
754
xtest10:
755
        mvts    $0,PSW
756
        add     $8,$0,returnState
757
        stw     $4,$8,0*4                ; pointer to interrupt context
758
        stw     $31,$8,1*4              ; return address
759
        stw     $29,$8,2*4              ; stack pointer
760
        stw     $16,$8,3*4              ; local variables
761
        stw     $17,$8,4*4
762
        stw     $18,$8,5*4
763
        stw     $19,$8,6*4
764
        stw     $20,$8,7*4
765
        stw     $21,$8,8*4
766
        stw     $22,$8,9*4
767
        stw     $23,$8,10*4
768
        .nosyn
769
        add     $28,$4,$0
770
        ldw     $8,$28,33*4             ; tlbIndex
771
        mvts    $8,TLB_INDEX
772
        ldw     $8,$28,34*4             ; tlbWntryHi
773
        mvts    $8,TLB_ENTRY_HI
774
        ldw     $8,$28,35*4             ; tlbEntryLo
775
        mvts    $8,TLB_ENTRY_LO
776
        ;ldw    $0,$28,0*4              ; registers
777
        ldw     $1,$28,1*4
778
        ldw     $2,$28,2*4
779
        ldw     $3,$28,3*4
780
        ldw     $4,$28,4*4
781
        ldw     $5,$28,5*4
782
        ldw     $6,$28,6*4
783
        ldw     $7,$28,7*4
784
        ldw     $8,$28,8*4
785
        ldw     $9,$28,9*4
786
        ldw     $10,$28,10*4
787
        ldw     $11,$28,11*4
788
        ldw     $12,$28,12*4
789
        ldw     $13,$28,13*4
790
        ldw     $14,$28,14*4
791
        ldw     $15,$28,15*4
792
        ldw     $16,$28,16*4
793
        ldw     $17,$28,17*4
794
        ldw     $18,$28,18*4
795
        ldw     $19,$28,19*4
796
        ldw     $20,$28,20*4
797
        ldw     $21,$28,21*4
798
        ldw     $22,$28,22*4
799
        ldw     $23,$28,23*4
800
        ldw     $24,$28,24*4
801
        ldw     $25,$28,25*4
802
        ldw     $26,$28,26*4
803
        ldw     $27,$28,27*4
804
        ;ldw    $28,$28,28*4
805
        ldw     $29,$28,29*4
806
        ldw     $30,$28,30*4
807
        ldw     $31,$28,31*4
808
        ldw     $28,$28,32*4            ; psw
809
        mvts    $28,PSW
810
xtest10x:
811
        remu    $5,$7,0
812
        j       halt
813
        .syn
814
 
815
xtest11:
816
        mvts    $0,PSW
817
        add     $8,$0,returnState
818
        stw     $4,$8,0*4                ; pointer to interrupt context
819
        stw     $31,$8,1*4              ; return address
820
        stw     $29,$8,2*4              ; stack pointer
821
        stw     $16,$8,3*4              ; local variables
822
        stw     $17,$8,4*4
823
        stw     $18,$8,5*4
824
        stw     $19,$8,6*4
825
        stw     $20,$8,7*4
826
        stw     $21,$8,8*4
827
        stw     $22,$8,9*4
828
        stw     $23,$8,10*4
829
        .nosyn
830
        add     $28,$4,$0
831
        ldw     $8,$28,33*4             ; tlbIndex
832
        mvts    $8,TLB_INDEX
833
        ldw     $8,$28,34*4             ; tlbWntryHi
834
        mvts    $8,TLB_ENTRY_HI
835
        ldw     $8,$28,35*4             ; tlbEntryLo
836
        mvts    $8,TLB_ENTRY_LO
837
        ;ldw    $0,$28,0*4              ; registers
838
        ldw     $1,$28,1*4
839
        ldw     $2,$28,2*4
840
        ldw     $3,$28,3*4
841
        ldw     $4,$28,4*4
842
        ldw     $5,$28,5*4
843
        ldw     $6,$28,6*4
844
        ldw     $7,$28,7*4
845
        ldw     $8,$28,8*4
846
        ldw     $9,$28,9*4
847
        ldw     $10,$28,10*4
848
        ldw     $11,$28,11*4
849
        ldw     $12,$28,12*4
850
        ldw     $13,$28,13*4
851
        ldw     $14,$28,14*4
852
        ldw     $15,$28,15*4
853
        ldw     $16,$28,16*4
854
        ldw     $17,$28,17*4
855
        ldw     $18,$28,18*4
856
        ldw     $19,$28,19*4
857
        ldw     $20,$28,20*4
858
        ldw     $21,$28,21*4
859
        ldw     $22,$28,22*4
860
        ldw     $23,$28,23*4
861
        ldw     $24,$28,24*4
862
        ldw     $25,$28,25*4
863
        ldw     $26,$28,26*4
864
        ldw     $27,$28,27*4
865
        ;ldw    $28,$28,28*4
866
        ldw     $29,$28,29*4
867
        ldw     $30,$28,30*4
868
        ldw     $31,$28,31*4
869
        ldw     $28,$28,32*4            ; psw
870
        mvts    $28,PSW
871
;xtest11x:
872
        .set    xtest11x,0xFFFFFF10
873
        jr      $15
874
        j       halt
875
        .syn
876
 
877
xtest12:
878
        mvts    $0,PSW
879
        add     $8,$0,returnState
880
        stw     $4,$8,0*4                ; pointer to interrupt context
881
        stw     $31,$8,1*4              ; return address
882
        stw     $29,$8,2*4              ; stack pointer
883
        stw     $16,$8,3*4              ; local variables
884
        stw     $17,$8,4*4
885
        stw     $18,$8,5*4
886
        stw     $19,$8,6*4
887
        stw     $20,$8,7*4
888
        stw     $21,$8,8*4
889
        stw     $22,$8,9*4
890
        stw     $23,$8,10*4
891
        .nosyn
892
        add     $28,$4,$0
893
        ldw     $8,$28,33*4             ; tlbIndex
894
        mvts    $8,TLB_INDEX
895
        ldw     $8,$28,34*4             ; tlbWntryHi
896
        mvts    $8,TLB_ENTRY_HI
897
        ldw     $8,$28,35*4             ; tlbEntryLo
898
        mvts    $8,TLB_ENTRY_LO
899
        ;ldw    $0,$28,0*4              ; registers
900
        ldw     $1,$28,1*4
901
        ldw     $2,$28,2*4
902
        ldw     $3,$28,3*4
903
        ldw     $4,$28,4*4
904
        ldw     $5,$28,5*4
905
        ldw     $6,$28,6*4
906
        ldw     $7,$28,7*4
907
        ldw     $8,$28,8*4
908
        ldw     $9,$28,9*4
909
        ldw     $10,$28,10*4
910
        ldw     $11,$28,11*4
911
        ldw     $12,$28,12*4
912
        ldw     $13,$28,13*4
913
        ldw     $14,$28,14*4
914
        ldw     $15,$28,15*4
915
        ldw     $16,$28,16*4
916
        ldw     $17,$28,17*4
917
        ldw     $18,$28,18*4
918
        ldw     $19,$28,19*4
919
        ldw     $20,$28,20*4
920
        ldw     $21,$28,21*4
921
        ldw     $22,$28,22*4
922
        ldw     $23,$28,23*4
923
        ldw     $24,$28,24*4
924
        ldw     $25,$28,25*4
925
        ldw     $26,$28,26*4
926
        ldw     $27,$28,27*4
927
        ;ldw    $28,$28,28*4
928
        ldw     $29,$28,29*4
929
        ldw     $30,$28,30*4
930
        ldw     $31,$28,31*4
931
        ldw     $28,$28,32*4            ; psw
932
        mvts    $28,PSW
933
xtest12x:
934
        ldw     $5,$15,0
935
        j       halt
936
        .syn
937
 
938
xtest13:
939
        mvts    $0,PSW
940
        add     $8,$0,returnState
941
        stw     $4,$8,0*4                ; pointer to interrupt context
942
        stw     $31,$8,1*4              ; return address
943
        stw     $29,$8,2*4              ; stack pointer
944
        stw     $16,$8,3*4              ; local variables
945
        stw     $17,$8,4*4
946
        stw     $18,$8,5*4
947
        stw     $19,$8,6*4
948
        stw     $20,$8,7*4
949
        stw     $21,$8,8*4
950
        stw     $22,$8,9*4
951
        stw     $23,$8,10*4
952
        .nosyn
953
        add     $28,$4,$0
954
        ldw     $8,$28,33*4             ; tlbIndex
955
        mvts    $8,TLB_INDEX
956
        ldw     $8,$28,34*4             ; tlbWntryHi
957
        mvts    $8,TLB_ENTRY_HI
958
        ldw     $8,$28,35*4             ; tlbEntryLo
959
        mvts    $8,TLB_ENTRY_LO
960
        ;ldw    $0,$28,0*4              ; registers
961
        ldw     $1,$28,1*4
962
        ldw     $2,$28,2*4
963
        ldw     $3,$28,3*4
964
        ldw     $4,$28,4*4
965
        ldw     $5,$28,5*4
966
        ldw     $6,$28,6*4
967
        ldw     $7,$28,7*4
968
        ldw     $8,$28,8*4
969
        ldw     $9,$28,9*4
970
        ldw     $10,$28,10*4
971
        ldw     $11,$28,11*4
972
        ldw     $12,$28,12*4
973
        ldw     $13,$28,13*4
974
        ldw     $14,$28,14*4
975
        ldw     $15,$28,15*4
976
        ldw     $16,$28,16*4
977
        ldw     $17,$28,17*4
978
        ldw     $18,$28,18*4
979
        ldw     $19,$28,19*4
980
        ldw     $20,$28,20*4
981
        ldw     $21,$28,21*4
982
        ldw     $22,$28,22*4
983
        ldw     $23,$28,23*4
984
        ldw     $24,$28,24*4
985
        ldw     $25,$28,25*4
986
        ldw     $26,$28,26*4
987
        ldw     $27,$28,27*4
988
        ;ldw    $28,$28,28*4
989
        ldw     $29,$28,29*4
990
        ldw     $30,$28,30*4
991
        ldw     $31,$28,31*4
992
        ldw     $28,$28,32*4            ; psw
993
        mvts    $28,PSW
994
xtest13x:
995
        stw     $5,$15,0
996
        j       halt
997
        .syn
998
 
999
xtest14:
1000
        mvts    $0,PSW
1001
        add     $8,$0,returnState
1002
        stw     $4,$8,0*4                ; pointer to interrupt context
1003
        stw     $31,$8,1*4              ; return address
1004
        stw     $29,$8,2*4              ; stack pointer
1005
        stw     $16,$8,3*4              ; local variables
1006
        stw     $17,$8,4*4
1007
        stw     $18,$8,5*4
1008
        stw     $19,$8,6*4
1009
        stw     $20,$8,7*4
1010
        stw     $21,$8,8*4
1011
        stw     $22,$8,9*4
1012
        stw     $23,$8,10*4
1013
        add     $16,$0,xtest14v          ; switch to virtual addressing
1014
        add     $8,$0,11
1015
        mvts    $8,TLB_INDEX
1016
        and     $8,$16,0x3FFFF000
1017
        mvts    $8,TLB_ENTRY_HI
1018
        and     $8,$16,0x3FFFF000
1019
        or      $8,$8,3
1020
        mvts    $8,TLB_ENTRY_LO
1021
        tbwi
1022
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
1023
        add     $8,$8,1
1024
        mvts    $8,TLB_INDEX
1025
        mvfs    $8,TLB_ENTRY_HI
1026
        add     $8,$8,0x1000
1027
        mvts    $8,TLB_ENTRY_HI
1028
        mvfs    $8,TLB_ENTRY_LO
1029
        add     $8,$8,0x1000
1030
        mvts    $8,TLB_ENTRY_LO
1031
        tbwi
1032
        and     $16,$16,0x3FFFFFFF
1033
        jr      $16
1034
xtest14v:
1035
        .nosyn
1036
        add     $28,$4,$0
1037
        ldw     $8,$28,33*4             ; tlbIndex
1038
        mvts    $8,TLB_INDEX
1039
        ldw     $8,$28,34*4             ; tlbWntryHi
1040
        mvts    $8,TLB_ENTRY_HI
1041
        ldw     $8,$28,35*4             ; tlbEntryLo
1042
        mvts    $8,TLB_ENTRY_LO
1043
        ;ldw    $0,$28,0*4              ; registers
1044
        ldw     $1,$28,1*4
1045
        ldw     $2,$28,2*4
1046
        ldw     $3,$28,3*4
1047
        ldw     $4,$28,4*4
1048
        ldw     $5,$28,5*4
1049
        ldw     $6,$28,6*4
1050
        ldw     $7,$28,7*4
1051
        ldw     $8,$28,8*4
1052
        ldw     $9,$28,9*4
1053
        ldw     $10,$28,10*4
1054
        ldw     $11,$28,11*4
1055
        ldw     $12,$28,12*4
1056
        ldw     $13,$28,13*4
1057
        ldw     $14,$28,14*4
1058
        ldw     $15,$28,15*4
1059
        ldw     $16,$28,16*4
1060
        ldw     $17,$28,17*4
1061
        ldw     $18,$28,18*4
1062
        ldw     $19,$28,19*4
1063
        ldw     $20,$28,20*4
1064
        ldw     $21,$28,21*4
1065
        ldw     $22,$28,22*4
1066
        ldw     $23,$28,23*4
1067
        ldw     $24,$28,24*4
1068
        ldw     $25,$28,25*4
1069
        ldw     $26,$28,26*4
1070
        ldw     $27,$28,27*4
1071
        ;ldw    $28,$28,28*4
1072
        ldw     $29,$28,29*4
1073
        ldw     $30,$28,30*4
1074
        ldw     $31,$28,31*4
1075
        ldw     $28,$28,32*4            ; psw
1076
        mvts    $28,PSW
1077
xtest14x:
1078
        rfx
1079
        j       halt
1080
        .syn
1081
 
1082
xtest15:
1083
        mvts    $0,PSW
1084
        add     $8,$0,returnState
1085
        stw     $4,$8,0*4                ; pointer to interrupt context
1086
        stw     $31,$8,1*4              ; return address
1087
        stw     $29,$8,2*4              ; stack pointer
1088
        stw     $16,$8,3*4              ; local variables
1089
        stw     $17,$8,4*4
1090
        stw     $18,$8,5*4
1091
        stw     $19,$8,6*4
1092
        stw     $20,$8,7*4
1093
        stw     $21,$8,8*4
1094
        stw     $22,$8,9*4
1095
        stw     $23,$8,10*4
1096
        add     $16,$0,xtest15v          ; switch to virtual addressing
1097
        add     $8,$0,11
1098
        mvts    $8,TLB_INDEX
1099
        and     $8,$16,0x3FFFF000
1100
        mvts    $8,TLB_ENTRY_HI
1101
        and     $8,$16,0x3FFFF000
1102
        or      $8,$8,3
1103
        mvts    $8,TLB_ENTRY_LO
1104
        tbwi
1105
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
1106
        add     $8,$8,1
1107
        mvts    $8,TLB_INDEX
1108
        mvfs    $8,TLB_ENTRY_HI
1109
        add     $8,$8,0x1000
1110
        mvts    $8,TLB_ENTRY_HI
1111
        mvfs    $8,TLB_ENTRY_LO
1112
        add     $8,$8,0x1000
1113
        mvts    $8,TLB_ENTRY_LO
1114
        tbwi
1115
        and     $16,$16,0x3FFFFFFF
1116
        jr      $16
1117
xtest15v:
1118
        .nosyn
1119
        add     $28,$4,$0
1120
        ldw     $8,$28,33*4             ; tlbIndex
1121
        mvts    $8,TLB_INDEX
1122
        ldw     $8,$28,34*4             ; tlbWntryHi
1123
        mvts    $8,TLB_ENTRY_HI
1124
        ldw     $8,$28,35*4             ; tlbEntryLo
1125
        mvts    $8,TLB_ENTRY_LO
1126
        ;ldw    $0,$28,0*4              ; registers
1127
        ldw     $1,$28,1*4
1128
        ldw     $2,$28,2*4
1129
        ldw     $3,$28,3*4
1130
        ldw     $4,$28,4*4
1131
        ldw     $5,$28,5*4
1132
        ldw     $6,$28,6*4
1133
        ldw     $7,$28,7*4
1134
        ldw     $8,$28,8*4
1135
        ldw     $9,$28,9*4
1136
        ldw     $10,$28,10*4
1137
        ldw     $11,$28,11*4
1138
        ldw     $12,$28,12*4
1139
        ldw     $13,$28,13*4
1140
        ldw     $14,$28,14*4
1141
        ldw     $15,$28,15*4
1142
        ldw     $16,$28,16*4
1143
        ldw     $17,$28,17*4
1144
        ldw     $18,$28,18*4
1145
        ldw     $19,$28,19*4
1146
        ldw     $20,$28,20*4
1147
        ldw     $21,$28,21*4
1148
        ldw     $22,$28,22*4
1149
        ldw     $23,$28,23*4
1150
        ldw     $24,$28,24*4
1151
        ldw     $25,$28,25*4
1152
        ldw     $26,$28,26*4
1153
        ldw     $27,$28,27*4
1154
        ;ldw    $28,$28,28*4
1155
        ldw     $29,$28,29*4
1156
        ldw     $30,$28,30*4
1157
        ldw     $31,$28,31*4
1158
        ldw     $28,$28,32*4            ; psw
1159
        mvts    $28,PSW
1160
xtest15x:
1161
        mvts    $0,PSW
1162
        j       halt
1163
        .syn
1164
 
1165
xtest16:
1166
        mvts    $0,PSW
1167
        add     $8,$0,returnState
1168
        stw     $4,$8,0*4                ; pointer to interrupt context
1169
        stw     $31,$8,1*4              ; return address
1170
        stw     $29,$8,2*4              ; stack pointer
1171
        stw     $16,$8,3*4              ; local variables
1172
        stw     $17,$8,4*4
1173
        stw     $18,$8,5*4
1174
        stw     $19,$8,6*4
1175
        stw     $20,$8,7*4
1176
        stw     $21,$8,8*4
1177
        stw     $22,$8,9*4
1178
        stw     $23,$8,10*4
1179
        add     $16,$0,xtest16v          ; switch to virtual addressing
1180
        add     $8,$0,11
1181
        mvts    $8,TLB_INDEX
1182
        and     $8,$16,0x3FFFF000
1183
        mvts    $8,TLB_ENTRY_HI
1184
        and     $8,$16,0x3FFFF000
1185
        or      $8,$8,3
1186
        mvts    $8,TLB_ENTRY_LO
1187
        tbwi
1188
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
1189
        add     $8,$8,1
1190
        mvts    $8,TLB_INDEX
1191
        mvfs    $8,TLB_ENTRY_HI
1192
        add     $8,$8,0x1000
1193
        mvts    $8,TLB_ENTRY_HI
1194
        mvfs    $8,TLB_ENTRY_LO
1195
        add     $8,$8,0x1000
1196
        mvts    $8,TLB_ENTRY_LO
1197
        tbwi
1198
        and     $16,$16,0x3FFFFFFF
1199
        jr      $16
1200
xtest16v:
1201
        .nosyn
1202
        add     $28,$4,$0
1203
        ldw     $8,$28,33*4             ; tlbIndex
1204
        mvts    $8,TLB_INDEX
1205
        ldw     $8,$28,34*4             ; tlbWntryHi
1206
        mvts    $8,TLB_ENTRY_HI
1207
        ldw     $8,$28,35*4             ; tlbEntryLo
1208
        mvts    $8,TLB_ENTRY_LO
1209
        ;ldw    $0,$28,0*4              ; registers
1210
        ldw     $1,$28,1*4
1211
        ldw     $2,$28,2*4
1212
        ldw     $3,$28,3*4
1213
        ldw     $4,$28,4*4
1214
        ldw     $5,$28,5*4
1215
        ldw     $6,$28,6*4
1216
        ldw     $7,$28,7*4
1217
        ldw     $8,$28,8*4
1218
        ldw     $9,$28,9*4
1219
        ldw     $10,$28,10*4
1220
        ldw     $11,$28,11*4
1221
        ldw     $12,$28,12*4
1222
        ldw     $13,$28,13*4
1223
        ldw     $14,$28,14*4
1224
        ldw     $15,$28,15*4
1225
        ldw     $16,$28,16*4
1226
        ldw     $17,$28,17*4
1227
        ldw     $18,$28,18*4
1228
        ldw     $19,$28,19*4
1229
        ldw     $20,$28,20*4
1230
        ldw     $21,$28,21*4
1231
        ldw     $22,$28,22*4
1232
        ldw     $23,$28,23*4
1233
        ldw     $24,$28,24*4
1234
        ldw     $25,$28,25*4
1235
        ldw     $26,$28,26*4
1236
        ldw     $27,$28,27*4
1237
        ;ldw    $28,$28,28*4
1238
        ldw     $29,$28,29*4
1239
        ldw     $30,$28,30*4
1240
        ldw     $31,$28,31*4
1241
        ldw     $28,$28,32*4            ; psw
1242
        mvts    $28,PSW
1243
xtest16x:
1244
        tbs
1245
        j       halt
1246
        .syn
1247
 
1248
xtest17:
1249
        mvts    $0,PSW
1250
        add     $8,$0,returnState
1251
        stw     $4,$8,0*4                ; pointer to interrupt context
1252
        stw     $31,$8,1*4              ; return address
1253
        stw     $29,$8,2*4              ; stack pointer
1254
        stw     $16,$8,3*4              ; local variables
1255
        stw     $17,$8,4*4
1256
        stw     $18,$8,5*4
1257
        stw     $19,$8,6*4
1258
        stw     $20,$8,7*4
1259
        stw     $21,$8,8*4
1260
        stw     $22,$8,9*4
1261
        stw     $23,$8,10*4
1262
        add     $16,$0,xtest17v          ; switch to virtual addressing
1263
        add     $8,$0,11
1264
        mvts    $8,TLB_INDEX
1265
        and     $8,$16,0x3FFFF000
1266
        mvts    $8,TLB_ENTRY_HI
1267
        and     $8,$16,0x3FFFF000
1268
        or      $8,$8,3
1269
        mvts    $8,TLB_ENTRY_LO
1270
        tbwi
1271
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
1272
        add     $8,$8,1
1273
        mvts    $8,TLB_INDEX
1274
        mvfs    $8,TLB_ENTRY_HI
1275
        add     $8,$8,0x1000
1276
        mvts    $8,TLB_ENTRY_HI
1277
        mvfs    $8,TLB_ENTRY_LO
1278
        add     $8,$8,0x1000
1279
        mvts    $8,TLB_ENTRY_LO
1280
        tbwi
1281
        and     $16,$16,0x3FFFFFFF
1282
        jr      $16
1283
xtest17v:
1284
        .nosyn
1285
        add     $28,$4,$0
1286
        ldw     $8,$28,33*4             ; tlbIndex
1287
        mvts    $8,TLB_INDEX
1288
        ldw     $8,$28,34*4             ; tlbWntryHi
1289
        mvts    $8,TLB_ENTRY_HI
1290
        ldw     $8,$28,35*4             ; tlbEntryLo
1291
        mvts    $8,TLB_ENTRY_LO
1292
        ;ldw    $0,$28,0*4              ; registers
1293
        ldw     $1,$28,1*4
1294
        ldw     $2,$28,2*4
1295
        ldw     $3,$28,3*4
1296
        ldw     $4,$28,4*4
1297
        ldw     $5,$28,5*4
1298
        ldw     $6,$28,6*4
1299
        ldw     $7,$28,7*4
1300
        ldw     $8,$28,8*4
1301
        ldw     $9,$28,9*4
1302
        ldw     $10,$28,10*4
1303
        ldw     $11,$28,11*4
1304
        ldw     $12,$28,12*4
1305
        ldw     $13,$28,13*4
1306
        ldw     $14,$28,14*4
1307
        ldw     $15,$28,15*4
1308
        ldw     $16,$28,16*4
1309
        ldw     $17,$28,17*4
1310
        ldw     $18,$28,18*4
1311
        ldw     $19,$28,19*4
1312
        ldw     $20,$28,20*4
1313
        ldw     $21,$28,21*4
1314
        ldw     $22,$28,22*4
1315
        ldw     $23,$28,23*4
1316
        ldw     $24,$28,24*4
1317
        ldw     $25,$28,25*4
1318
        ldw     $26,$28,26*4
1319
        ldw     $27,$28,27*4
1320
        ;ldw    $28,$28,28*4
1321
        ldw     $29,$28,29*4
1322
        ldw     $30,$28,30*4
1323
        ldw     $31,$28,31*4
1324
        ldw     $28,$28,32*4            ; psw
1325
        mvts    $28,PSW
1326
;xtest17x:
1327
        .set    xtest17x,0xFFFFFF10
1328
        jr      $15
1329
        j       halt
1330
        .syn
1331
 
1332
xtest18:
1333
        mvts    $0,PSW
1334
        add     $8,$0,returnState
1335
        stw     $4,$8,0*4                ; pointer to interrupt context
1336
        stw     $31,$8,1*4              ; return address
1337
        stw     $29,$8,2*4              ; stack pointer
1338
        stw     $16,$8,3*4              ; local variables
1339
        stw     $17,$8,4*4
1340
        stw     $18,$8,5*4
1341
        stw     $19,$8,6*4
1342
        stw     $20,$8,7*4
1343
        stw     $21,$8,8*4
1344
        stw     $22,$8,9*4
1345
        stw     $23,$8,10*4
1346
        add     $16,$0,xtest18v          ; switch to virtual addressing
1347
        add     $8,$0,11
1348
        mvts    $8,TLB_INDEX
1349
        and     $8,$16,0x3FFFF000
1350
        mvts    $8,TLB_ENTRY_HI
1351
        and     $8,$16,0x3FFFF000
1352
        or      $8,$8,3
1353
        mvts    $8,TLB_ENTRY_LO
1354
        tbwi
1355
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
1356
        add     $8,$8,1
1357
        mvts    $8,TLB_INDEX
1358
        mvfs    $8,TLB_ENTRY_HI
1359
        add     $8,$8,0x1000
1360
        mvts    $8,TLB_ENTRY_HI
1361
        mvfs    $8,TLB_ENTRY_LO
1362
        add     $8,$8,0x1000
1363
        mvts    $8,TLB_ENTRY_LO
1364
        tbwi
1365
        and     $16,$16,0x3FFFFFFF
1366
        jr      $16
1367
xtest18v:
1368
        .nosyn
1369
        add     $28,$4,$0
1370
        ldw     $8,$28,33*4             ; tlbIndex
1371
        mvts    $8,TLB_INDEX
1372
        ldw     $8,$28,34*4             ; tlbWntryHi
1373
        mvts    $8,TLB_ENTRY_HI
1374
        ldw     $8,$28,35*4             ; tlbEntryLo
1375
        mvts    $8,TLB_ENTRY_LO
1376
        ;ldw    $0,$28,0*4              ; registers
1377
        ldw     $1,$28,1*4
1378
        ldw     $2,$28,2*4
1379
        ldw     $3,$28,3*4
1380
        ldw     $4,$28,4*4
1381
        ldw     $5,$28,5*4
1382
        ldw     $6,$28,6*4
1383
        ldw     $7,$28,7*4
1384
        ldw     $8,$28,8*4
1385
        ldw     $9,$28,9*4
1386
        ldw     $10,$28,10*4
1387
        ldw     $11,$28,11*4
1388
        ldw     $12,$28,12*4
1389
        ldw     $13,$28,13*4
1390
        ldw     $14,$28,14*4
1391
        ldw     $15,$28,15*4
1392
        ldw     $16,$28,16*4
1393
        ldw     $17,$28,17*4
1394
        ldw     $18,$28,18*4
1395
        ldw     $19,$28,19*4
1396
        ldw     $20,$28,20*4
1397
        ldw     $21,$28,21*4
1398
        ldw     $22,$28,22*4
1399
        ldw     $23,$28,23*4
1400
        ldw     $24,$28,24*4
1401
        ldw     $25,$28,25*4
1402
        ldw     $26,$28,26*4
1403
        ldw     $27,$28,27*4
1404
        ;ldw    $28,$28,28*4
1405
        ldw     $29,$28,29*4
1406
        ldw     $30,$28,30*4
1407
        ldw     $31,$28,31*4
1408
        ldw     $28,$28,32*4            ; psw
1409
        mvts    $28,PSW
1410
xtest18x:
1411
        ldw     $5,$15,0
1412
        j       halt
1413
        .syn
1414
 
1415
xtest19:
1416
        mvts    $0,PSW
1417
        add     $8,$0,returnState
1418
        stw     $4,$8,0*4                ; pointer to interrupt context
1419
        stw     $31,$8,1*4              ; return address
1420
        stw     $29,$8,2*4              ; stack pointer
1421
        stw     $16,$8,3*4              ; local variables
1422
        stw     $17,$8,4*4
1423
        stw     $18,$8,5*4
1424
        stw     $19,$8,6*4
1425
        stw     $20,$8,7*4
1426
        stw     $21,$8,8*4
1427
        stw     $22,$8,9*4
1428
        stw     $23,$8,10*4
1429
        add     $16,$0,xtest19v          ; switch to virtual addressing
1430
        add     $8,$0,11
1431
        mvts    $8,TLB_INDEX
1432
        and     $8,$16,0x3FFFF000
1433
        mvts    $8,TLB_ENTRY_HI
1434
        and     $8,$16,0x3FFFF000
1435
        or      $8,$8,3
1436
        mvts    $8,TLB_ENTRY_LO
1437
        tbwi
1438
        mvfs    $8,TLB_INDEX            ; we could cross a page boundary
1439
        add     $8,$8,1
1440
        mvts    $8,TLB_INDEX
1441
        mvfs    $8,TLB_ENTRY_HI
1442
        add     $8,$8,0x1000
1443
        mvts    $8,TLB_ENTRY_HI
1444
        mvfs    $8,TLB_ENTRY_LO
1445
        add     $8,$8,0x1000
1446
        mvts    $8,TLB_ENTRY_LO
1447
        tbwi
1448
        and     $16,$16,0x3FFFFFFF
1449
        jr      $16
1450
xtest19v:
1451
        .nosyn
1452
        add     $28,$4,$0
1453
        ldw     $8,$28,33*4             ; tlbIndex
1454
        mvts    $8,TLB_INDEX
1455
        ldw     $8,$28,34*4             ; tlbWntryHi
1456
        mvts    $8,TLB_ENTRY_HI
1457
        ldw     $8,$28,35*4             ; tlbEntryLo
1458
        mvts    $8,TLB_ENTRY_LO
1459
        ;ldw    $0,$28,0*4              ; registers
1460
        ldw     $1,$28,1*4
1461
        ldw     $2,$28,2*4
1462
        ldw     $3,$28,3*4
1463
        ldw     $4,$28,4*4
1464
        ldw     $5,$28,5*4
1465
        ldw     $6,$28,6*4
1466
        ldw     $7,$28,7*4
1467
        ldw     $8,$28,8*4
1468
        ldw     $9,$28,9*4
1469
        ldw     $10,$28,10*4
1470
        ldw     $11,$28,11*4
1471
        ldw     $12,$28,12*4
1472
        ldw     $13,$28,13*4
1473
        ldw     $14,$28,14*4
1474
        ldw     $15,$28,15*4
1475
        ldw     $16,$28,16*4
1476
        ldw     $17,$28,17*4
1477
        ldw     $18,$28,18*4
1478
        ldw     $19,$28,19*4
1479
        ldw     $20,$28,20*4
1480
        ldw     $21,$28,21*4
1481
        ldw     $22,$28,22*4
1482
        ldw     $23,$28,23*4
1483
        ldw     $24,$28,24*4
1484
        ldw     $25,$28,25*4
1485
        ldw     $26,$28,26*4
1486
        ldw     $27,$28,27*4
1487
        ;ldw    $28,$28,28*4
1488
        ldw     $29,$28,29*4
1489
        ldw     $30,$28,30*4
1490
        ldw     $31,$28,31*4
1491
        ldw     $28,$28,32*4            ; psw
1492
        mvts    $28,PSW
1493
xtest19x:
1494
        stw     $5,$15,0
1495
        j       halt
1496
        .syn
1497
 
1498
xtest20:
1499
        mvts    $0,PSW
1500
        add     $8,$0,returnState
1501
        stw     $4,$8,0*4                ; pointer to interrupt context
1502
        stw     $31,$8,1*4              ; return address
1503
        stw     $29,$8,2*4              ; stack pointer
1504
        stw     $16,$8,3*4              ; local variables
1505
        stw     $17,$8,4*4
1506
        stw     $18,$8,5*4
1507
        stw     $19,$8,6*4
1508
        stw     $20,$8,7*4
1509
        stw     $21,$8,8*4
1510
        stw     $22,$8,9*4
1511
        stw     $23,$8,10*4
1512
        .nosyn
1513
        add     $28,$4,$0
1514
        ldw     $8,$28,33*4             ; tlbIndex
1515
        mvts    $8,TLB_INDEX
1516
        ldw     $8,$28,34*4             ; tlbWntryHi
1517
        mvts    $8,TLB_ENTRY_HI
1518
        ldw     $8,$28,35*4             ; tlbEntryLo
1519
        mvts    $8,TLB_ENTRY_LO
1520
        ;ldw    $0,$28,0*4              ; registers
1521
        ldw     $1,$28,1*4
1522
        ldw     $2,$28,2*4
1523
        ldw     $3,$28,3*4
1524
        ldw     $4,$28,4*4
1525
        ldw     $5,$28,5*4
1526
        ldw     $6,$28,6*4
1527
        ldw     $7,$28,7*4
1528
        ldw     $8,$28,8*4
1529
        ldw     $9,$28,9*4
1530
        ldw     $10,$28,10*4
1531
        ldw     $11,$28,11*4
1532
        ldw     $12,$28,12*4
1533
        ldw     $13,$28,13*4
1534
        ldw     $14,$28,14*4
1535
        ldw     $15,$28,15*4
1536
        ldw     $16,$28,16*4
1537
        ldw     $17,$28,17*4
1538
        ldw     $18,$28,18*4
1539
        ldw     $19,$28,19*4
1540
        ldw     $20,$28,20*4
1541
        ldw     $21,$28,21*4
1542
        ldw     $22,$28,22*4
1543
        ldw     $23,$28,23*4
1544
        ldw     $24,$28,24*4
1545
        ldw     $25,$28,25*4
1546
        ldw     $26,$28,26*4
1547
        ldw     $27,$28,27*4
1548
        ;ldw    $28,$28,28*4
1549
        ldw     $29,$28,29*4
1550
        ldw     $30,$28,30*4
1551
        ldw     $31,$28,31*4
1552
        ldw     $28,$28,32*4            ; psw
1553
        mvts    $28,PSW
1554
;xtest20x:
1555
        .set    xtest20x,0x11111122
1556
        jr      $17
1557
        j       halt
1558
        .syn
1559
 
1560
xtest21:
1561
        mvts    $0,PSW
1562
        add     $8,$0,returnState
1563
        stw     $4,$8,0*4                ; pointer to interrupt context
1564
        stw     $31,$8,1*4              ; return address
1565
        stw     $29,$8,2*4              ; stack pointer
1566
        stw     $16,$8,3*4              ; local variables
1567
        stw     $17,$8,4*4
1568
        stw     $18,$8,5*4
1569
        stw     $19,$8,6*4
1570
        stw     $20,$8,7*4
1571
        stw     $21,$8,8*4
1572
        stw     $22,$8,9*4
1573
        stw     $23,$8,10*4
1574
        .nosyn
1575
        add     $28,$4,$0
1576
        ldw     $8,$28,33*4             ; tlbIndex
1577
        mvts    $8,TLB_INDEX
1578
        ldw     $8,$28,34*4             ; tlbWntryHi
1579
        mvts    $8,TLB_ENTRY_HI
1580
        ldw     $8,$28,35*4             ; tlbEntryLo
1581
        mvts    $8,TLB_ENTRY_LO
1582
        ;ldw    $0,$28,0*4              ; registers
1583
        ldw     $1,$28,1*4
1584
        ldw     $2,$28,2*4
1585
        ldw     $3,$28,3*4
1586
        ldw     $4,$28,4*4
1587
        ldw     $5,$28,5*4
1588
        ldw     $6,$28,6*4
1589
        ldw     $7,$28,7*4
1590
        ldw     $8,$28,8*4
1591
        ldw     $9,$28,9*4
1592
        ldw     $10,$28,10*4
1593
        ldw     $11,$28,11*4
1594
        ldw     $12,$28,12*4
1595
        ldw     $13,$28,13*4
1596
        ldw     $14,$28,14*4
1597
        ldw     $15,$28,15*4
1598
        ldw     $16,$28,16*4
1599
        ldw     $17,$28,17*4
1600
        ldw     $18,$28,18*4
1601
        ldw     $19,$28,19*4
1602
        ldw     $20,$28,20*4
1603
        ldw     $21,$28,21*4
1604
        ldw     $22,$28,22*4
1605
        ldw     $23,$28,23*4
1606
        ldw     $24,$28,24*4
1607
        ldw     $25,$28,25*4
1608
        ldw     $26,$28,26*4
1609
        ldw     $27,$28,27*4
1610
        ;ldw    $28,$28,28*4
1611
        ldw     $29,$28,29*4
1612
        ldw     $30,$28,30*4
1613
        ldw     $31,$28,31*4
1614
        ldw     $28,$28,32*4            ; psw
1615
        mvts    $28,PSW
1616
;xtest21x:
1617
        .set    xtest21x,0x00000021
1618
        jr      $16
1619
        j       halt
1620
        .syn
1621
 
1622
xtest22:
1623
        mvts    $0,PSW
1624
        add     $8,$0,returnState
1625
        stw     $4,$8,0*4                ; pointer to interrupt context
1626
        stw     $31,$8,1*4              ; return address
1627
        stw     $29,$8,2*4              ; stack pointer
1628
        stw     $16,$8,3*4              ; local variables
1629
        stw     $17,$8,4*4
1630
        stw     $18,$8,5*4
1631
        stw     $19,$8,6*4
1632
        stw     $20,$8,7*4
1633
        stw     $21,$8,8*4
1634
        stw     $22,$8,9*4
1635
        stw     $23,$8,10*4
1636
        .nosyn
1637
        add     $28,$4,$0
1638
        ldw     $8,$28,33*4             ; tlbIndex
1639
        mvts    $8,TLB_INDEX
1640
        ldw     $8,$28,34*4             ; tlbWntryHi
1641
        mvts    $8,TLB_ENTRY_HI
1642
        ldw     $8,$28,35*4             ; tlbEntryLo
1643
        mvts    $8,TLB_ENTRY_LO
1644
        ;ldw    $0,$28,0*4              ; registers
1645
        ldw     $1,$28,1*4
1646
        ldw     $2,$28,2*4
1647
        ldw     $3,$28,3*4
1648
        ldw     $4,$28,4*4
1649
        ldw     $5,$28,5*4
1650
        ldw     $6,$28,6*4
1651
        ldw     $7,$28,7*4
1652
        ldw     $8,$28,8*4
1653
        ldw     $9,$28,9*4
1654
        ldw     $10,$28,10*4
1655
        ldw     $11,$28,11*4
1656
        ldw     $12,$28,12*4
1657
        ldw     $13,$28,13*4
1658
        ldw     $14,$28,14*4
1659
        ldw     $15,$28,15*4
1660
        ldw     $16,$28,16*4
1661
        ldw     $17,$28,17*4
1662
        ldw     $18,$28,18*4
1663
        ldw     $19,$28,19*4
1664
        ldw     $20,$28,20*4
1665
        ldw     $21,$28,21*4
1666
        ldw     $22,$28,22*4
1667
        ldw     $23,$28,23*4
1668
        ldw     $24,$28,24*4
1669
        ldw     $25,$28,25*4
1670
        ldw     $26,$28,26*4
1671
        ldw     $27,$28,27*4
1672
        ;ldw    $28,$28,28*4
1673
        ldw     $29,$28,29*4
1674
        ldw     $30,$28,30*4
1675
        ldw     $31,$28,31*4
1676
        ldw     $28,$28,32*4            ; psw
1677
        mvts    $28,PSW
1678
xtest22x:
1679
        ldw     $5,$15,2
1680
        j       halt
1681
        .syn
1682
 
1683
xtest23:
1684
        mvts    $0,PSW
1685
        add     $8,$0,returnState
1686
        stw     $4,$8,0*4                ; pointer to interrupt context
1687
        stw     $31,$8,1*4              ; return address
1688
        stw     $29,$8,2*4              ; stack pointer
1689
        stw     $16,$8,3*4              ; local variables
1690
        stw     $17,$8,4*4
1691
        stw     $18,$8,5*4
1692
        stw     $19,$8,6*4
1693
        stw     $20,$8,7*4
1694
        stw     $21,$8,8*4
1695
        stw     $22,$8,9*4
1696
        stw     $23,$8,10*4
1697
        .nosyn
1698
        add     $28,$4,$0
1699
        ldw     $8,$28,33*4             ; tlbIndex
1700
        mvts    $8,TLB_INDEX
1701
        ldw     $8,$28,34*4             ; tlbWntryHi
1702
        mvts    $8,TLB_ENTRY_HI
1703
        ldw     $8,$28,35*4             ; tlbEntryLo
1704
        mvts    $8,TLB_ENTRY_LO
1705
        ;ldw    $0,$28,0*4              ; registers
1706
        ldw     $1,$28,1*4
1707
        ldw     $2,$28,2*4
1708
        ldw     $3,$28,3*4
1709
        ldw     $4,$28,4*4
1710
        ldw     $5,$28,5*4
1711
        ldw     $6,$28,6*4
1712
        ldw     $7,$28,7*4
1713
        ldw     $8,$28,8*4
1714
        ldw     $9,$28,9*4
1715
        ldw     $10,$28,10*4
1716
        ldw     $11,$28,11*4
1717
        ldw     $12,$28,12*4
1718
        ldw     $13,$28,13*4
1719
        ldw     $14,$28,14*4
1720
        ldw     $15,$28,15*4
1721
        ldw     $16,$28,16*4
1722
        ldw     $17,$28,17*4
1723
        ldw     $18,$28,18*4
1724
        ldw     $19,$28,19*4
1725
        ldw     $20,$28,20*4
1726
        ldw     $21,$28,21*4
1727
        ldw     $22,$28,22*4
1728
        ldw     $23,$28,23*4
1729
        ldw     $24,$28,24*4
1730
        ldw     $25,$28,25*4
1731
        ldw     $26,$28,26*4
1732
        ldw     $27,$28,27*4
1733
        ;ldw    $28,$28,28*4
1734
        ldw     $29,$28,29*4
1735
        ldw     $30,$28,30*4
1736
        ldw     $31,$28,31*4
1737
        ldw     $28,$28,32*4            ; psw
1738
        mvts    $28,PSW
1739
xtest23x:
1740
        ldw     $5,$15,1
1741
        j       halt
1742
        .syn
1743
 
1744
xtest24:
1745
        mvts    $0,PSW
1746
        add     $8,$0,returnState
1747
        stw     $4,$8,0*4                ; pointer to interrupt context
1748
        stw     $31,$8,1*4              ; return address
1749
        stw     $29,$8,2*4              ; stack pointer
1750
        stw     $16,$8,3*4              ; local variables
1751
        stw     $17,$8,4*4
1752
        stw     $18,$8,5*4
1753
        stw     $19,$8,6*4
1754
        stw     $20,$8,7*4
1755
        stw     $21,$8,8*4
1756
        stw     $22,$8,9*4
1757
        stw     $23,$8,10*4
1758
        .nosyn
1759
        add     $28,$4,$0
1760
        ldw     $8,$28,33*4             ; tlbIndex
1761
        mvts    $8,TLB_INDEX
1762
        ldw     $8,$28,34*4             ; tlbWntryHi
1763
        mvts    $8,TLB_ENTRY_HI
1764
        ldw     $8,$28,35*4             ; tlbEntryLo
1765
        mvts    $8,TLB_ENTRY_LO
1766
        ;ldw    $0,$28,0*4              ; registers
1767
        ldw     $1,$28,1*4
1768
        ldw     $2,$28,2*4
1769
        ldw     $3,$28,3*4
1770
        ldw     $4,$28,4*4
1771
        ldw     $5,$28,5*4
1772
        ldw     $6,$28,6*4
1773
        ldw     $7,$28,7*4
1774
        ldw     $8,$28,8*4
1775
        ldw     $9,$28,9*4
1776
        ldw     $10,$28,10*4
1777
        ldw     $11,$28,11*4
1778
        ldw     $12,$28,12*4
1779
        ldw     $13,$28,13*4
1780
        ldw     $14,$28,14*4
1781
        ldw     $15,$28,15*4
1782
        ldw     $16,$28,16*4
1783
        ldw     $17,$28,17*4
1784
        ldw     $18,$28,18*4
1785
        ldw     $19,$28,19*4
1786
        ldw     $20,$28,20*4
1787
        ldw     $21,$28,21*4
1788
        ldw     $22,$28,22*4
1789
        ldw     $23,$28,23*4
1790
        ldw     $24,$28,24*4
1791
        ldw     $25,$28,25*4
1792
        ldw     $26,$28,26*4
1793
        ldw     $27,$28,27*4
1794
        ;ldw    $28,$28,28*4
1795
        ldw     $29,$28,29*4
1796
        ldw     $30,$28,30*4
1797
        ldw     $31,$28,31*4
1798
        ldw     $28,$28,32*4            ; psw
1799
        mvts    $28,PSW
1800
xtest24x:
1801
        ldh     $5,$15,1
1802
        j       halt
1803
        .syn
1804
 
1805
xtest25:
1806
        mvts    $0,PSW
1807
        add     $8,$0,returnState
1808
        stw     $4,$8,0*4                ; pointer to interrupt context
1809
        stw     $31,$8,1*4              ; return address
1810
        stw     $29,$8,2*4              ; stack pointer
1811
        stw     $16,$8,3*4              ; local variables
1812
        stw     $17,$8,4*4
1813
        stw     $18,$8,5*4
1814
        stw     $19,$8,6*4
1815
        stw     $20,$8,7*4
1816
        stw     $21,$8,8*4
1817
        stw     $22,$8,9*4
1818
        stw     $23,$8,10*4
1819
        .nosyn
1820
        add     $28,$4,$0
1821
        ldw     $8,$28,33*4             ; tlbIndex
1822
        mvts    $8,TLB_INDEX
1823
        ldw     $8,$28,34*4             ; tlbWntryHi
1824
        mvts    $8,TLB_ENTRY_HI
1825
        ldw     $8,$28,35*4             ; tlbEntryLo
1826
        mvts    $8,TLB_ENTRY_LO
1827
        ;ldw    $0,$28,0*4              ; registers
1828
        ldw     $1,$28,1*4
1829
        ldw     $2,$28,2*4
1830
        ldw     $3,$28,3*4
1831
        ldw     $4,$28,4*4
1832
        ldw     $5,$28,5*4
1833
        ldw     $6,$28,6*4
1834
        ldw     $7,$28,7*4
1835
        ldw     $8,$28,8*4
1836
        ldw     $9,$28,9*4
1837
        ldw     $10,$28,10*4
1838
        ldw     $11,$28,11*4
1839
        ldw     $12,$28,12*4
1840
        ldw     $13,$28,13*4
1841
        ldw     $14,$28,14*4
1842
        ldw     $15,$28,15*4
1843
        ldw     $16,$28,16*4
1844
        ldw     $17,$28,17*4
1845
        ldw     $18,$28,18*4
1846
        ldw     $19,$28,19*4
1847
        ldw     $20,$28,20*4
1848
        ldw     $21,$28,21*4
1849
        ldw     $22,$28,22*4
1850
        ldw     $23,$28,23*4
1851
        ldw     $24,$28,24*4
1852
        ldw     $25,$28,25*4
1853
        ldw     $26,$28,26*4
1854
        ldw     $27,$28,27*4
1855
        ;ldw    $28,$28,28*4
1856
        ldw     $29,$28,29*4
1857
        ldw     $30,$28,30*4
1858
        ldw     $31,$28,31*4
1859
        ldw     $28,$28,32*4            ; psw
1860
        mvts    $28,PSW
1861
xtest25x:
1862
        stw     $5,$15,2
1863
        j       halt
1864
        .syn
1865
 
1866
xtest26:
1867
        mvts    $0,PSW
1868
        add     $8,$0,returnState
1869
        stw     $4,$8,0*4                ; pointer to interrupt context
1870
        stw     $31,$8,1*4              ; return address
1871
        stw     $29,$8,2*4              ; stack pointer
1872
        stw     $16,$8,3*4              ; local variables
1873
        stw     $17,$8,4*4
1874
        stw     $18,$8,5*4
1875
        stw     $19,$8,6*4
1876
        stw     $20,$8,7*4
1877
        stw     $21,$8,8*4
1878
        stw     $22,$8,9*4
1879
        stw     $23,$8,10*4
1880
        .nosyn
1881
        add     $28,$4,$0
1882
        ldw     $8,$28,33*4             ; tlbIndex
1883
        mvts    $8,TLB_INDEX
1884
        ldw     $8,$28,34*4             ; tlbWntryHi
1885
        mvts    $8,TLB_ENTRY_HI
1886
        ldw     $8,$28,35*4             ; tlbEntryLo
1887
        mvts    $8,TLB_ENTRY_LO
1888
        ;ldw    $0,$28,0*4              ; registers
1889
        ldw     $1,$28,1*4
1890
        ldw     $2,$28,2*4
1891
        ldw     $3,$28,3*4
1892
        ldw     $4,$28,4*4
1893
        ldw     $5,$28,5*4
1894
        ldw     $6,$28,6*4
1895
        ldw     $7,$28,7*4
1896
        ldw     $8,$28,8*4
1897
        ldw     $9,$28,9*4
1898
        ldw     $10,$28,10*4
1899
        ldw     $11,$28,11*4
1900
        ldw     $12,$28,12*4
1901
        ldw     $13,$28,13*4
1902
        ldw     $14,$28,14*4
1903
        ldw     $15,$28,15*4
1904
        ldw     $16,$28,16*4
1905
        ldw     $17,$28,17*4
1906
        ldw     $18,$28,18*4
1907
        ldw     $19,$28,19*4
1908
        ldw     $20,$28,20*4
1909
        ldw     $21,$28,21*4
1910
        ldw     $22,$28,22*4
1911
        ldw     $23,$28,23*4
1912
        ldw     $24,$28,24*4
1913
        ldw     $25,$28,25*4
1914
        ldw     $26,$28,26*4
1915
        ldw     $27,$28,27*4
1916
        ;ldw    $28,$28,28*4
1917
        ldw     $29,$28,29*4
1918
        ldw     $30,$28,30*4
1919
        ldw     $31,$28,31*4
1920
        ldw     $28,$28,32*4            ; psw
1921
        mvts    $28,PSW
1922
xtest26x:
1923
        stw     $5,$15,1
1924
        j       halt
1925
        .syn
1926
 
1927
xtest27:
1928
        mvts    $0,PSW
1929
        add     $8,$0,returnState
1930
        stw     $4,$8,0*4                ; pointer to interrupt context
1931
        stw     $31,$8,1*4              ; return address
1932
        stw     $29,$8,2*4              ; stack pointer
1933
        stw     $16,$8,3*4              ; local variables
1934
        stw     $17,$8,4*4
1935
        stw     $18,$8,5*4
1936
        stw     $19,$8,6*4
1937
        stw     $20,$8,7*4
1938
        stw     $21,$8,8*4
1939
        stw     $22,$8,9*4
1940
        stw     $23,$8,10*4
1941
        .nosyn
1942
        add     $28,$4,$0
1943
        ldw     $8,$28,33*4             ; tlbIndex
1944
        mvts    $8,TLB_INDEX
1945
        ldw     $8,$28,34*4             ; tlbWntryHi
1946
        mvts    $8,TLB_ENTRY_HI
1947
        ldw     $8,$28,35*4             ; tlbEntryLo
1948
        mvts    $8,TLB_ENTRY_LO
1949
        ;ldw    $0,$28,0*4              ; registers
1950
        ldw     $1,$28,1*4
1951
        ldw     $2,$28,2*4
1952
        ldw     $3,$28,3*4
1953
        ldw     $4,$28,4*4
1954
        ldw     $5,$28,5*4
1955
        ldw     $6,$28,6*4
1956
        ldw     $7,$28,7*4
1957
        ldw     $8,$28,8*4
1958
        ldw     $9,$28,9*4
1959
        ldw     $10,$28,10*4
1960
        ldw     $11,$28,11*4
1961
        ldw     $12,$28,12*4
1962
        ldw     $13,$28,13*4
1963
        ldw     $14,$28,14*4
1964
        ldw     $15,$28,15*4
1965
        ldw     $16,$28,16*4
1966
        ldw     $17,$28,17*4
1967
        ldw     $18,$28,18*4
1968
        ldw     $19,$28,19*4
1969
        ldw     $20,$28,20*4
1970
        ldw     $21,$28,21*4
1971
        ldw     $22,$28,22*4
1972
        ldw     $23,$28,23*4
1973
        ldw     $24,$28,24*4
1974
        ldw     $25,$28,25*4
1975
        ldw     $26,$28,26*4
1976
        ldw     $27,$28,27*4
1977
        ;ldw    $28,$28,28*4
1978
        ldw     $29,$28,29*4
1979
        ldw     $30,$28,30*4
1980
        ldw     $31,$28,31*4
1981
        ldw     $28,$28,32*4            ; psw
1982
        mvts    $28,PSW
1983
xtest27x:
1984
        sth     $5,$15,1
1985
        j       halt
1986
        .syn
1987
 
1988
xtest28:
1989
        mvts    $0,PSW
1990
        add     $8,$0,returnState
1991
        stw     $4,$8,0*4                ; pointer to interrupt context
1992
        stw     $31,$8,1*4              ; return address
1993
        stw     $29,$8,2*4              ; stack pointer
1994
        stw     $16,$8,3*4              ; local variables
1995
        stw     $17,$8,4*4
1996
        stw     $18,$8,5*4
1997
        stw     $19,$8,6*4
1998
        stw     $20,$8,7*4
1999
        stw     $21,$8,8*4
2000
        stw     $22,$8,9*4
2001
        stw     $23,$8,10*4
2002
        .nosyn
2003
        add     $28,$4,$0
2004
        ldw     $8,$28,33*4             ; tlbIndex
2005
        mvts    $8,TLB_INDEX
2006
        ldw     $8,$28,34*4             ; tlbWntryHi
2007
        mvts    $8,TLB_ENTRY_HI
2008
        ldw     $8,$28,35*4             ; tlbEntryLo
2009
        mvts    $8,TLB_ENTRY_LO
2010
        ;ldw    $0,$28,0*4              ; registers
2011
        ldw     $1,$28,1*4
2012
        ldw     $2,$28,2*4
2013
        ldw     $3,$28,3*4
2014
        ldw     $4,$28,4*4
2015
        ldw     $5,$28,5*4
2016
        ldw     $6,$28,6*4
2017
        ldw     $7,$28,7*4
2018
        ldw     $8,$28,8*4
2019
        ldw     $9,$28,9*4
2020
        ldw     $10,$28,10*4
2021
        ldw     $11,$28,11*4
2022
        ldw     $12,$28,12*4
2023
        ldw     $13,$28,13*4
2024
        ldw     $14,$28,14*4
2025
        ldw     $15,$28,15*4
2026
        ldw     $16,$28,16*4
2027
        ldw     $17,$28,17*4
2028
        ldw     $18,$28,18*4
2029
        ldw     $19,$28,19*4
2030
        ldw     $20,$28,20*4
2031
        ldw     $21,$28,21*4
2032
        ldw     $22,$28,22*4
2033
        ldw     $23,$28,23*4
2034
        ldw     $24,$28,24*4
2035
        ldw     $25,$28,25*4
2036
        ldw     $26,$28,26*4
2037
        ldw     $27,$28,27*4
2038
        ;ldw    $28,$28,28*4
2039
        ldw     $29,$28,29*4
2040
        ldw     $30,$28,30*4
2041
        ldw     $31,$28,31*4
2042
        ldw     $28,$28,32*4            ; psw
2043
        mvts    $28,PSW
2044
;xtest28x:
2045
        .set    xtest28x,0x33333314
2046
        jr      $3
2047
        j       halt
2048
        .syn
2049
 
2050
xtest29:
2051
        mvts    $0,PSW
2052
        add     $8,$0,returnState
2053
        stw     $4,$8,0*4                ; pointer to interrupt context
2054
        stw     $31,$8,1*4              ; return address
2055
        stw     $29,$8,2*4              ; stack pointer
2056
        stw     $16,$8,3*4              ; local variables
2057
        stw     $17,$8,4*4
2058
        stw     $18,$8,5*4
2059
        stw     $19,$8,6*4
2060
        stw     $20,$8,7*4
2061
        stw     $21,$8,8*4
2062
        stw     $22,$8,9*4
2063
        stw     $23,$8,10*4
2064
        .nosyn
2065
        add     $28,$4,$0
2066
        ldw     $8,$28,33*4             ; tlbIndex
2067
        mvts    $8,TLB_INDEX
2068
        ldw     $8,$28,34*4             ; tlbWntryHi
2069
        mvts    $8,TLB_ENTRY_HI
2070
        ldw     $8,$28,35*4             ; tlbEntryLo
2071
        mvts    $8,TLB_ENTRY_LO
2072
        ;ldw    $0,$28,0*4              ; registers
2073
        ldw     $1,$28,1*4
2074
        ldw     $2,$28,2*4
2075
        ldw     $3,$28,3*4
2076
        ldw     $4,$28,4*4
2077
        ldw     $5,$28,5*4
2078
        ldw     $6,$28,6*4
2079
        ldw     $7,$28,7*4
2080
        ldw     $8,$28,8*4
2081
        ldw     $9,$28,9*4
2082
        ldw     $10,$28,10*4
2083
        ldw     $11,$28,11*4
2084
        ldw     $12,$28,12*4
2085
        ldw     $13,$28,13*4
2086
        ldw     $14,$28,14*4
2087
        ldw     $15,$28,15*4
2088
        ldw     $16,$28,16*4
2089
        ldw     $17,$28,17*4
2090
        ldw     $18,$28,18*4
2091
        ldw     $19,$28,19*4
2092
        ldw     $20,$28,20*4
2093
        ldw     $21,$28,21*4
2094
        ldw     $22,$28,22*4
2095
        ldw     $23,$28,23*4
2096
        ldw     $24,$28,24*4
2097
        ldw     $25,$28,25*4
2098
        ldw     $26,$28,26*4
2099
        ldw     $27,$28,27*4
2100
        ;ldw    $28,$28,28*4
2101
        ldw     $29,$28,29*4
2102
        ldw     $30,$28,30*4
2103
        ldw     $31,$28,31*4
2104
        ldw     $28,$28,32*4            ; psw
2105
        mvts    $28,PSW
2106
xtest29x:
2107
        ldw     $5,$3,0
2108
        j       halt
2109
        .syn
2110
 
2111
xtest30:
2112
        mvts    $0,PSW
2113
        add     $8,$0,returnState
2114
        stw     $4,$8,0*4                ; pointer to interrupt context
2115
        stw     $31,$8,1*4              ; return address
2116
        stw     $29,$8,2*4              ; stack pointer
2117
        stw     $16,$8,3*4              ; local variables
2118
        stw     $17,$8,4*4
2119
        stw     $18,$8,5*4
2120
        stw     $19,$8,6*4
2121
        stw     $20,$8,7*4
2122
        stw     $21,$8,8*4
2123
        stw     $22,$8,9*4
2124
        stw     $23,$8,10*4
2125
        .nosyn
2126
        add     $28,$4,$0
2127
        ldw     $8,$28,33*4             ; tlbIndex
2128
        mvts    $8,TLB_INDEX
2129
        ldw     $8,$28,34*4             ; tlbWntryHi
2130
        mvts    $8,TLB_ENTRY_HI
2131
        ldw     $8,$28,35*4             ; tlbEntryLo
2132
        mvts    $8,TLB_ENTRY_LO
2133
        ;ldw    $0,$28,0*4              ; registers
2134
        ldw     $1,$28,1*4
2135
        ldw     $2,$28,2*4
2136
        ldw     $3,$28,3*4
2137
        ldw     $4,$28,4*4
2138
        ldw     $5,$28,5*4
2139
        ldw     $6,$28,6*4
2140
        ldw     $7,$28,7*4
2141
        ldw     $8,$28,8*4
2142
        ldw     $9,$28,9*4
2143
        ldw     $10,$28,10*4
2144
        ldw     $11,$28,11*4
2145
        ldw     $12,$28,12*4
2146
        ldw     $13,$28,13*4
2147
        ldw     $14,$28,14*4
2148
        ldw     $15,$28,15*4
2149
        ldw     $16,$28,16*4
2150
        ldw     $17,$28,17*4
2151
        ldw     $18,$28,18*4
2152
        ldw     $19,$28,19*4
2153
        ldw     $20,$28,20*4
2154
        ldw     $21,$28,21*4
2155
        ldw     $22,$28,22*4
2156
        ldw     $23,$28,23*4
2157
        ldw     $24,$28,24*4
2158
        ldw     $25,$28,25*4
2159
        ldw     $26,$28,26*4
2160
        ldw     $27,$28,27*4
2161
        ;ldw    $28,$28,28*4
2162
        ldw     $29,$28,29*4
2163
        ldw     $30,$28,30*4
2164
        ldw     $31,$28,31*4
2165
        ldw     $28,$28,32*4            ; psw
2166
        mvts    $28,PSW
2167
xtest30x:
2168
        stw     $5,$3,0
2169
        j       halt
2170
        .syn
2171
 
2172
xtest31:
2173
        mvts    $0,PSW
2174
        add     $8,$0,returnState
2175
        stw     $4,$8,0*4                ; pointer to interrupt context
2176
        stw     $31,$8,1*4              ; return address
2177
        stw     $29,$8,2*4              ; stack pointer
2178
        stw     $16,$8,3*4              ; local variables
2179
        stw     $17,$8,4*4
2180
        stw     $18,$8,5*4
2181
        stw     $19,$8,6*4
2182
        stw     $20,$8,7*4
2183
        stw     $21,$8,8*4
2184
        stw     $22,$8,9*4
2185
        stw     $23,$8,10*4
2186
        .nosyn
2187
        add     $28,$4,$0
2188
        ldw     $8,$28,33*4             ; tlbIndex
2189
        mvts    $8,TLB_INDEX
2190
        ldw     $8,$28,34*4             ; tlbWntryHi
2191
        mvts    $8,TLB_ENTRY_HI
2192
        ldw     $8,$28,35*4             ; tlbEntryLo
2193
        mvts    $8,TLB_ENTRY_LO
2194
        ;ldw    $0,$28,0*4              ; registers
2195
        ldw     $1,$28,1*4
2196
        ldw     $2,$28,2*4
2197
        ldw     $3,$28,3*4
2198
        ldw     $4,$28,4*4
2199
        ldw     $5,$28,5*4
2200
        ldw     $6,$28,6*4
2201
        ldw     $7,$28,7*4
2202
        ldw     $8,$28,8*4
2203
        ldw     $9,$28,9*4
2204
        ldw     $10,$28,10*4
2205
        ldw     $11,$28,11*4
2206
        ldw     $12,$28,12*4
2207
        ldw     $13,$28,13*4
2208
        ldw     $14,$28,14*4
2209
        ldw     $15,$28,15*4
2210
        ldw     $16,$28,16*4
2211
        ldw     $17,$28,17*4
2212
        ldw     $18,$28,18*4
2213
        ldw     $19,$28,19*4
2214
        ldw     $20,$28,20*4
2215
        ldw     $21,$28,21*4
2216
        ldw     $22,$28,22*4
2217
        ldw     $23,$28,23*4
2218
        ldw     $24,$28,24*4
2219
        ldw     $25,$28,25*4
2220
        ldw     $26,$28,26*4
2221
        ldw     $27,$28,27*4
2222
        ;ldw    $28,$28,28*4
2223
        ldw     $29,$28,29*4
2224
        ldw     $30,$28,30*4
2225
        ldw     $31,$28,31*4
2226
        ldw     $28,$28,32*4            ; psw
2227
        mvts    $28,PSW
2228
;xtest31x:
2229
        .set    xtest31x,0xBBBBBB1C
2230
        jr      $11
2231
        j       halt
2232
        .syn
2233
 
2234
xtest32:
2235
        mvts    $0,PSW
2236
        add     $8,$0,returnState
2237
        stw     $4,$8,0*4                ; pointer to interrupt context
2238
        stw     $31,$8,1*4              ; return address
2239
        stw     $29,$8,2*4              ; stack pointer
2240
        stw     $16,$8,3*4              ; local variables
2241
        stw     $17,$8,4*4
2242
        stw     $18,$8,5*4
2243
        stw     $19,$8,6*4
2244
        stw     $20,$8,7*4
2245
        stw     $21,$8,8*4
2246
        stw     $22,$8,9*4
2247
        stw     $23,$8,10*4
2248
        .nosyn
2249
        add     $28,$4,$0
2250
        ldw     $8,$28,33*4             ; tlbIndex
2251
        mvts    $8,TLB_INDEX
2252
        ldw     $8,$28,34*4             ; tlbWntryHi
2253
        mvts    $8,TLB_ENTRY_HI
2254
        ldw     $8,$28,35*4             ; tlbEntryLo
2255
        mvts    $8,TLB_ENTRY_LO
2256
        ;ldw    $0,$28,0*4              ; registers
2257
        ldw     $1,$28,1*4
2258
        ldw     $2,$28,2*4
2259
        ldw     $3,$28,3*4
2260
        ldw     $4,$28,4*4
2261
        ldw     $5,$28,5*4
2262
        ldw     $6,$28,6*4
2263
        ldw     $7,$28,7*4
2264
        ldw     $8,$28,8*4
2265
        ldw     $9,$28,9*4
2266
        ldw     $10,$28,10*4
2267
        ldw     $11,$28,11*4
2268
        ldw     $12,$28,12*4
2269
        ldw     $13,$28,13*4
2270
        ldw     $14,$28,14*4
2271
        ldw     $15,$28,15*4
2272
        ldw     $16,$28,16*4
2273
        ldw     $17,$28,17*4
2274
        ldw     $18,$28,18*4
2275
        ldw     $19,$28,19*4
2276
        ldw     $20,$28,20*4
2277
        ldw     $21,$28,21*4
2278
        ldw     $22,$28,22*4
2279
        ldw     $23,$28,23*4
2280
        ldw     $24,$28,24*4
2281
        ldw     $25,$28,25*4
2282
        ldw     $26,$28,26*4
2283
        ldw     $27,$28,27*4
2284
        ;ldw    $28,$28,28*4
2285
        ldw     $29,$28,29*4
2286
        ldw     $30,$28,30*4
2287
        ldw     $31,$28,31*4
2288
        ldw     $28,$28,32*4            ; psw
2289
        mvts    $28,PSW
2290
xtest32x:
2291
        ldw     $5,$11,0
2292
        j       halt
2293
        .syn
2294
 
2295
xtest33:
2296
        mvts    $0,PSW
2297
        add     $8,$0,returnState
2298
        stw     $4,$8,0*4                ; pointer to interrupt context
2299
        stw     $31,$8,1*4              ; return address
2300
        stw     $29,$8,2*4              ; stack pointer
2301
        stw     $16,$8,3*4              ; local variables
2302
        stw     $17,$8,4*4
2303
        stw     $18,$8,5*4
2304
        stw     $19,$8,6*4
2305
        stw     $20,$8,7*4
2306
        stw     $21,$8,8*4
2307
        stw     $22,$8,9*4
2308
        stw     $23,$8,10*4
2309
        .nosyn
2310
        add     $28,$4,$0
2311
        ldw     $8,$28,33*4             ; tlbIndex
2312
        mvts    $8,TLB_INDEX
2313
        ldw     $8,$28,34*4             ; tlbWntryHi
2314
        mvts    $8,TLB_ENTRY_HI
2315
        ldw     $8,$28,35*4             ; tlbEntryLo
2316
        mvts    $8,TLB_ENTRY_LO
2317
        ;ldw    $0,$28,0*4              ; registers
2318
        ldw     $1,$28,1*4
2319
        ldw     $2,$28,2*4
2320
        ldw     $3,$28,3*4
2321
        ldw     $4,$28,4*4
2322
        ldw     $5,$28,5*4
2323
        ldw     $6,$28,6*4
2324
        ldw     $7,$28,7*4
2325
        ldw     $8,$28,8*4
2326
        ldw     $9,$28,9*4
2327
        ldw     $10,$28,10*4
2328
        ldw     $11,$28,11*4
2329
        ldw     $12,$28,12*4
2330
        ldw     $13,$28,13*4
2331
        ldw     $14,$28,14*4
2332
        ldw     $15,$28,15*4
2333
        ldw     $16,$28,16*4
2334
        ldw     $17,$28,17*4
2335
        ldw     $18,$28,18*4
2336
        ldw     $19,$28,19*4
2337
        ldw     $20,$28,20*4
2338
        ldw     $21,$28,21*4
2339
        ldw     $22,$28,22*4
2340
        ldw     $23,$28,23*4
2341
        ldw     $24,$28,24*4
2342
        ldw     $25,$28,25*4
2343
        ldw     $26,$28,26*4
2344
        ldw     $27,$28,27*4
2345
        ;ldw    $28,$28,28*4
2346
        ldw     $29,$28,29*4
2347
        ldw     $30,$28,30*4
2348
        ldw     $31,$28,31*4
2349
        ldw     $28,$28,32*4            ; psw
2350
        mvts    $28,PSW
2351
xtest33x:
2352
        stw     $5,$11,0
2353
        j       halt
2354
        .syn
2355
 
2356
xtest34:
2357
        mvts    $0,PSW
2358
        add     $8,$0,returnState
2359
        stw     $4,$8,0*4                ; pointer to interrupt context
2360
        stw     $31,$8,1*4              ; return address
2361
        stw     $29,$8,2*4              ; stack pointer
2362
        stw     $16,$8,3*4              ; local variables
2363
        stw     $17,$8,4*4
2364
        stw     $18,$8,5*4
2365
        stw     $19,$8,6*4
2366
        stw     $20,$8,7*4
2367
        stw     $21,$8,8*4
2368
        stw     $22,$8,9*4
2369
        stw     $23,$8,10*4
2370
        add     $8,$0,11         ; construct TLB entry
2371
        mvts    $8,TLB_INDEX
2372
        add     $8,$0,0xBBBBBB1C
2373
        and     $8,$8,0xFFFFF000
2374
        mvts    $8,TLB_ENTRY_HI
2375
        add     $8,$0,0
2376
        mvts    $8,TLB_ENTRY_LO
2377
        tbwi
2378
        .nosyn
2379
        add     $28,$4,$0
2380
        ldw     $8,$28,33*4             ; tlbIndex
2381
        mvts    $8,TLB_INDEX
2382
        ldw     $8,$28,34*4             ; tlbWntryHi
2383
        mvts    $8,TLB_ENTRY_HI
2384
        ldw     $8,$28,35*4             ; tlbEntryLo
2385
        mvts    $8,TLB_ENTRY_LO
2386
        ;ldw    $0,$28,0*4              ; registers
2387
        ldw     $1,$28,1*4
2388
        ldw     $2,$28,2*4
2389
        ldw     $3,$28,3*4
2390
        ldw     $4,$28,4*4
2391
        ldw     $5,$28,5*4
2392
        ldw     $6,$28,6*4
2393
        ldw     $7,$28,7*4
2394
        ldw     $8,$28,8*4
2395
        ldw     $9,$28,9*4
2396
        ldw     $10,$28,10*4
2397
        ldw     $11,$28,11*4
2398
        ldw     $12,$28,12*4
2399
        ldw     $13,$28,13*4
2400
        ldw     $14,$28,14*4
2401
        ldw     $15,$28,15*4
2402
        ldw     $16,$28,16*4
2403
        ldw     $17,$28,17*4
2404
        ldw     $18,$28,18*4
2405
        ldw     $19,$28,19*4
2406
        ldw     $20,$28,20*4
2407
        ldw     $21,$28,21*4
2408
        ldw     $22,$28,22*4
2409
        ldw     $23,$28,23*4
2410
        ldw     $24,$28,24*4
2411
        ldw     $25,$28,25*4
2412
        ldw     $26,$28,26*4
2413
        ldw     $27,$28,27*4
2414
        ;ldw    $28,$28,28*4
2415
        ldw     $29,$28,29*4
2416
        ldw     $30,$28,30*4
2417
        ldw     $31,$28,31*4
2418
        ldw     $28,$28,32*4            ; psw
2419
        mvts    $28,PSW
2420
;xtest34x:
2421
        .set    xtest34x,0xBBBBBB1C
2422
        jr      $11
2423
        j       halt
2424
        .syn
2425
 
2426
xtest35:
2427
        mvts    $0,PSW
2428
        add     $8,$0,returnState
2429
        stw     $4,$8,0*4                ; pointer to interrupt context
2430
        stw     $31,$8,1*4              ; return address
2431
        stw     $29,$8,2*4              ; stack pointer
2432
        stw     $16,$8,3*4              ; local variables
2433
        stw     $17,$8,4*4
2434
        stw     $18,$8,5*4
2435
        stw     $19,$8,6*4
2436
        stw     $20,$8,7*4
2437
        stw     $21,$8,8*4
2438
        stw     $22,$8,9*4
2439
        stw     $23,$8,10*4
2440
        add     $8,$0,11         ; construct TLB entry
2441
        mvts    $8,TLB_INDEX
2442
        add     $8,$0,0xBBBBBB1C
2443
        and     $8,$8,0xFFFFF000
2444
        mvts    $8,TLB_ENTRY_HI
2445
        add     $8,$0,0
2446
        mvts    $8,TLB_ENTRY_LO
2447
        tbwi
2448
        .nosyn
2449
        add     $28,$4,$0
2450
        ldw     $8,$28,33*4             ; tlbIndex
2451
        mvts    $8,TLB_INDEX
2452
        ldw     $8,$28,34*4             ; tlbWntryHi
2453
        mvts    $8,TLB_ENTRY_HI
2454
        ldw     $8,$28,35*4             ; tlbEntryLo
2455
        mvts    $8,TLB_ENTRY_LO
2456
        ;ldw    $0,$28,0*4              ; registers
2457
        ldw     $1,$28,1*4
2458
        ldw     $2,$28,2*4
2459
        ldw     $3,$28,3*4
2460
        ldw     $4,$28,4*4
2461
        ldw     $5,$28,5*4
2462
        ldw     $6,$28,6*4
2463
        ldw     $7,$28,7*4
2464
        ldw     $8,$28,8*4
2465
        ldw     $9,$28,9*4
2466
        ldw     $10,$28,10*4
2467
        ldw     $11,$28,11*4
2468
        ldw     $12,$28,12*4
2469
        ldw     $13,$28,13*4
2470
        ldw     $14,$28,14*4
2471
        ldw     $15,$28,15*4
2472
        ldw     $16,$28,16*4
2473
        ldw     $17,$28,17*4
2474
        ldw     $18,$28,18*4
2475
        ldw     $19,$28,19*4
2476
        ldw     $20,$28,20*4
2477
        ldw     $21,$28,21*4
2478
        ldw     $22,$28,22*4
2479
        ldw     $23,$28,23*4
2480
        ldw     $24,$28,24*4
2481
        ldw     $25,$28,25*4
2482
        ldw     $26,$28,26*4
2483
        ldw     $27,$28,27*4
2484
        ;ldw    $28,$28,28*4
2485
        ldw     $29,$28,29*4
2486
        ldw     $30,$28,30*4
2487
        ldw     $31,$28,31*4
2488
        ldw     $28,$28,32*4            ; psw
2489
        mvts    $28,PSW
2490
xtest35x:
2491
        ldw     $5,$11,0
2492
        j       halt
2493
        .syn
2494
 
2495
xtest36:
2496
        mvts    $0,PSW
2497
        add     $8,$0,returnState
2498
        stw     $4,$8,0*4                ; pointer to interrupt context
2499
        stw     $31,$8,1*4              ; return address
2500
        stw     $29,$8,2*4              ; stack pointer
2501
        stw     $16,$8,3*4              ; local variables
2502
        stw     $17,$8,4*4
2503
        stw     $18,$8,5*4
2504
        stw     $19,$8,6*4
2505
        stw     $20,$8,7*4
2506
        stw     $21,$8,8*4
2507
        stw     $22,$8,9*4
2508
        stw     $23,$8,10*4
2509
        add     $8,$0,11         ; construct TLB entry
2510
        mvts    $8,TLB_INDEX
2511
        add     $8,$0,0xBBBBBB1C
2512
        and     $8,$8,0xFFFFF000
2513
        mvts    $8,TLB_ENTRY_HI
2514
        add     $8,$0,0
2515
        mvts    $8,TLB_ENTRY_LO
2516
        tbwi
2517
        .nosyn
2518
        add     $28,$4,$0
2519
        ldw     $8,$28,33*4             ; tlbIndex
2520
        mvts    $8,TLB_INDEX
2521
        ldw     $8,$28,34*4             ; tlbWntryHi
2522
        mvts    $8,TLB_ENTRY_HI
2523
        ldw     $8,$28,35*4             ; tlbEntryLo
2524
        mvts    $8,TLB_ENTRY_LO
2525
        ;ldw    $0,$28,0*4              ; registers
2526
        ldw     $1,$28,1*4
2527
        ldw     $2,$28,2*4
2528
        ldw     $3,$28,3*4
2529
        ldw     $4,$28,4*4
2530
        ldw     $5,$28,5*4
2531
        ldw     $6,$28,6*4
2532
        ldw     $7,$28,7*4
2533
        ldw     $8,$28,8*4
2534
        ldw     $9,$28,9*4
2535
        ldw     $10,$28,10*4
2536
        ldw     $11,$28,11*4
2537
        ldw     $12,$28,12*4
2538
        ldw     $13,$28,13*4
2539
        ldw     $14,$28,14*4
2540
        ldw     $15,$28,15*4
2541
        ldw     $16,$28,16*4
2542
        ldw     $17,$28,17*4
2543
        ldw     $18,$28,18*4
2544
        ldw     $19,$28,19*4
2545
        ldw     $20,$28,20*4
2546
        ldw     $21,$28,21*4
2547
        ldw     $22,$28,22*4
2548
        ldw     $23,$28,23*4
2549
        ldw     $24,$28,24*4
2550
        ldw     $25,$28,25*4
2551
        ldw     $26,$28,26*4
2552
        ldw     $27,$28,27*4
2553
        ;ldw    $28,$28,28*4
2554
        ldw     $29,$28,29*4
2555
        ldw     $30,$28,30*4
2556
        ldw     $31,$28,31*4
2557
        ldw     $28,$28,32*4            ; psw
2558
        mvts    $28,PSW
2559
xtest36x:
2560
        stw     $5,$11,0
2561
        j       halt
2562
        .syn
2563
 
2564
xtest37:
2565
        mvts    $0,PSW
2566
        add     $8,$0,returnState
2567
        stw     $4,$8,0*4                ; pointer to interrupt context
2568
        stw     $31,$8,1*4              ; return address
2569
        stw     $29,$8,2*4              ; stack pointer
2570
        stw     $16,$8,3*4              ; local variables
2571
        stw     $17,$8,4*4
2572
        stw     $18,$8,5*4
2573
        stw     $19,$8,6*4
2574
        stw     $20,$8,7*4
2575
        stw     $21,$8,8*4
2576
        stw     $22,$8,9*4
2577
        stw     $23,$8,10*4
2578
        add     $8,$0,11         ; construct TLB entry
2579
        mvts    $8,TLB_INDEX
2580
        add     $8,$0,0xBBBBBB1C
2581
        and     $8,$8,0xFFFFF000
2582
        mvts    $8,TLB_ENTRY_HI
2583
        add     $8,$0,1
2584
        mvts    $8,TLB_ENTRY_LO
2585
        tbwi
2586
        .nosyn
2587
        add     $28,$4,$0
2588
        ldw     $8,$28,33*4             ; tlbIndex
2589
        mvts    $8,TLB_INDEX
2590
        ldw     $8,$28,34*4             ; tlbWntryHi
2591
        mvts    $8,TLB_ENTRY_HI
2592
        ldw     $8,$28,35*4             ; tlbEntryLo
2593
        mvts    $8,TLB_ENTRY_LO
2594
        ;ldw    $0,$28,0*4              ; registers
2595
        ldw     $1,$28,1*4
2596
        ldw     $2,$28,2*4
2597
        ldw     $3,$28,3*4
2598
        ldw     $4,$28,4*4
2599
        ldw     $5,$28,5*4
2600
        ldw     $6,$28,6*4
2601
        ldw     $7,$28,7*4
2602
        ldw     $8,$28,8*4
2603
        ldw     $9,$28,9*4
2604
        ldw     $10,$28,10*4
2605
        ldw     $11,$28,11*4
2606
        ldw     $12,$28,12*4
2607
        ldw     $13,$28,13*4
2608
        ldw     $14,$28,14*4
2609
        ldw     $15,$28,15*4
2610
        ldw     $16,$28,16*4
2611
        ldw     $17,$28,17*4
2612
        ldw     $18,$28,18*4
2613
        ldw     $19,$28,19*4
2614
        ldw     $20,$28,20*4
2615
        ldw     $21,$28,21*4
2616
        ldw     $22,$28,22*4
2617
        ldw     $23,$28,23*4
2618
        ldw     $24,$28,24*4
2619
        ldw     $25,$28,25*4
2620
        ldw     $26,$28,26*4
2621
        ldw     $27,$28,27*4
2622
        ;ldw    $28,$28,28*4
2623
        ldw     $29,$28,29*4
2624
        ldw     $30,$28,30*4
2625
        ldw     $31,$28,31*4
2626
        ldw     $28,$28,32*4            ; psw
2627
        mvts    $28,PSW
2628
xtest37x:
2629
        stw     $5,$11,0
2630
        j       halt
2631
        .syn
2632
 
2633
        ; last resort if the exception did not trigger
2634
halt:
2635
        j       halt
2636
 
2637
;***************************************************************
2638
 
2639
        ; Word getTLB_HI(int index)
2640
getTLB_HI:
2641
        mvts    $4,TLB_INDEX
2642
        tbri
2643
        mvfs    $2,TLB_ENTRY_HI
2644
        jr      $31
2645
 
2646
        ; Word getTLB_LO(int index)
2647
getTLB_LO:
2648
        mvts    $4,TLB_INDEX
2649
        tbri
2650
        mvfs    $2,TLB_ENTRY_LO
2651
        jr      $31
2652
 
2653
        ; void setTLB(int index, Word entryHi, Word entryLo)
2654
setTLB:
2655
        mvts    $4,TLB_INDEX
2656
        mvts    $5,TLB_ENTRY_HI
2657
        mvts    $6,TLB_ENTRY_LO
2658
        tbwi
2659
        jr      $31
2660
 
2661
;***************************************************************
2662
 
2663
        ; general interrupt entry
2664
isr:
2665
        .nosyn
2666
        ldhi    $28,userMissTaken       ; remember entry point
2667
        or      $28,$28,userMissTaken
2668
        stw     $0,$28,0
2669
        j       common
2670
 
2671
        ; TLB user miss entry
2672
umsr:
2673
        .nosyn
2674
        ldhi    $28,userMissTaken       ; remember entry point
2675
        or      $28,$28,userMissTaken
2676
        stw     $28,$28,0
2677
        j       common
2678
 
2679
common:
2680
        ldhi    $28,returnState
2681
        or      $28,$28,returnState
2682
        ldw     $28,$28,0                ; pointer to interrupt context
2683
        stw     $0,$28,0*4                ; registers
2684
        stw     $1,$28,1*4
2685
        stw     $2,$28,2*4
2686
        stw     $3,$28,3*4
2687
        stw     $4,$28,4*4
2688
        stw     $5,$28,5*4
2689
        stw     $6,$28,6*4
2690
        stw     $7,$28,7*4
2691
        stw     $8,$28,8*4
2692
        stw     $9,$28,9*4
2693
        stw     $10,$28,10*4
2694
        stw     $11,$28,11*4
2695
        stw     $12,$28,12*4
2696
        stw     $13,$28,13*4
2697
        stw     $14,$28,14*4
2698
        stw     $15,$28,15*4
2699
        stw     $16,$28,16*4
2700
        stw     $17,$28,17*4
2701
        stw     $18,$28,18*4
2702
        stw     $19,$28,19*4
2703
        stw     $20,$28,20*4
2704
        stw     $21,$28,21*4
2705
        stw     $22,$28,22*4
2706
        stw     $23,$28,23*4
2707
        stw     $24,$28,24*4
2708
        stw     $25,$28,25*4
2709
        stw     $26,$28,26*4
2710
        stw     $27,$28,27*4
2711
        stw     $28,$28,28*4
2712
        stw     $29,$28,29*4
2713
        stw     $30,$28,30*4
2714
        stw     $31,$28,31*4
2715
        mvfs    $8,PSW
2716
        stw     $8,$28,32*4             ; psw
2717
        mvfs    $8,TLB_INDEX
2718
        stw     $8,$28,33*4             ; tlbIndex
2719
        mvfs    $8,TLB_ENTRY_HI
2720
        stw     $8,$28,34*4             ; tlbEntryHi
2721
        mvfs    $8,TLB_ENTRY_LO
2722
        stw     $8,$28,35*4             ; tlbEntryLo
2723
        .syn
2724
        add     $8,$0,returnState
2725
        ldw     $4,$8,0*4                ; pointer to interrupt context
2726
        ldw     $31,$8,1*4              ; return address
2727
        ldw     $29,$8,2*4              ; stack pointer
2728
        ldw     $16,$8,3*4              ; local variables
2729
        ldw     $17,$8,4*4
2730
        ldw     $18,$8,5*4
2731
        ldw     $19,$8,6*4
2732
        ldw     $20,$8,7*4
2733
        ldw     $21,$8,8*4
2734
        ldw     $22,$8,9*4
2735
        ldw     $23,$8,10*4
2736
        jr      $31
2737
 
2738
        .bss
2739
        .align  4
2740
 
2741
        ; monitor state
2742
        ; stored when leaving to execute a user program
2743
        ; loaded when re-entering the monitor
2744
returnState:
2745
        .word   0                ; pointer to interrupt context
2746
        .word   0                ; $31 (return address)
2747
        .word   0                ; $29 (stack pointer)
2748
        .word   0                ; $16 (local variable)
2749
        .word   0                ; $17 (local variable)
2750
        .word   0                ; $18 (local variable)
2751
        .word   0                ; $19 (local variable)
2752
        .word   0                ; $20 (local variable)
2753
        .word   0                ; $21 (local variable)
2754
        .word   0                ; $22 (local variable)
2755
        .word   0                ; $23 (local variable)

powered by: WebSVN 2.1.0

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