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

Subversion Repositories eco32

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

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