Changeset 798 for soft/giet_vm/giet_kernel/giet.s
- Timestamp:
- Mar 2, 2016, 3:08:27 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/giet.s
r742 r798 39 39 _giet: 40 40 mfc0 $27, $13 /* $27 <= Cause register */ 41 la $26, _cause_vector /* $26 <= _cause_vector */ 42 andi $27, $27, 0x3c /* $27 <= XCODE*4 */ 43 addu $26, $26, $27 /* $26 <= &_cause_vector[XCODE] */ 44 lw $26, ($26) /* $26 <= _cause_vector[XCODE] */ 45 jr $26 /* Jump to handler indexed by XCODE */ 41 andi $27, $27, 0x3c /* $27 <= XCODE*4 */ 42 beq $27, $0, do_jump /* jump if interrupt */ 43 addiu $26, $0, 0x20 44 beq $27, $26, do_jump /* jump if syscall */ 45 /* Other exception: saving registers for future display */ 46 addiu $27, $29, -38*4 47 sw $29, (29*4)($27) 48 or $29, $27, $0 49 50 .set noat 51 sw $1, (1*4)($29) 52 .set at 53 sw $2, (2*4)($29) 54 sw $3, (3*4)($29) 55 sw $4, (4*4)($29) 56 sw $5, (5*4)($29) 57 sw $6, (6*4)($29) 58 sw $7, (7*4)($29) 59 sw $8, (8*4)($29) 60 sw $9, (9*4)($29) 61 sw $10, (10*4)($29) 62 sw $11, (11*4)($29) 63 sw $12, (12*4)($29) 64 sw $13, (13*4)($29) 65 sw $14, (14*4)($29) 66 sw $15, (15*4)($29) 67 sw $24, (24*4)($29) 68 sw $25, (25*4)($29) 69 sw $16, (16*4)($29) 70 mfc0 $16, $14 /* Read EPC */ 71 sw $17, (17*4)($29) 72 mfc0 $17, $13 /* read CR (used later) */ 73 sw $18, (18*4)($29) 74 mfc0 $18, $12 /* Read current SR (used later) */ 75 sw $19, (19*4)($29) 76 sw $20, (20*4)($29) 77 sw $21, (21*4)($29) 78 sw $22, (22*4)($29) 79 sw $23, (23*4)($29) 80 sw $30, (30*4)($29) 81 sw $28, (28*4)($29) 82 mflo $14 /* read LO */ 83 mfhi $15 /* read HI */ 84 sw $31, (31*4)($29) /* save RA */ 85 sw $16, (32*4)($29) /* Save EPC */ 86 sw $17, (33*4)($29) /* Save CR */ 87 sw $18, (34*4)($29) /* Save SR */ 88 sw $14, (35*4)($29) /* save LO */ 89 sw $15, (36*4)($29) /* save HI */ 90 or $4, $0, $27 91 92 93 do_jump: 94 mfc0 $27, $13 /* $27 <= Cause register */ 95 andi $27, $27, 0x3c /* $27 <= XCODE*4 */ 96 la $26, _cause_vector /* $26 <= _cause_vector */ 97 addu $26, $26, $27 /* $26 <= &_cause_vector[XCODE] */ 98 lw $26, 0($26) /* $26 <= _cause_vector[XCODE] */ 99 jr $26 /* Jump to handler indexed by XCODE */ 46 100 47 101 .endfunc
Note: See TracChangeset
for help on using the changeset viewer.