Cause register's value in MIPS32 architecture

0

If the value in the cause register is, for example, 0x00000100, how can I obtain the type of exception that has generated that code?(from the table below)

0 Int interrupt (hardware)

4 AdEL address error exception (load or instruction fetch)

5 AdES address error exception (store)

6 IBE bus error on instruction fetch

7 DBE bus error on data load or store

8 Sys syscall exception

9 Bp breakpoint exception

10 RI reserved instruction exception

11 CpU coprocessor unimplemented

12 Ov arithmetic overfl ow exception

13 Tr trap

15 FPE fl oating point
exception
exception-handling
mips
mips32
asked on Stack Overflow Feb 15, 2016 by Fred • edited Feb 16, 2016 by Konrad Lindenbach

1 Answer

2

This is described in the section named 6.15 Status Register (CP Register 12, Select 0) in MIPS32™ Architecture For Programmers Volume III: The MIPS32™ Privileged Resource Architecture.

Cause Register Format

31 | 30 | 29  28 | 27 24 | 23 | 22 | 21 16 | 15  8 | 7 | 6       2 | 1 0
------------------------------------------------------------------------
BD | 0  |   CE   |   0   | IV | WP  |  0   |   IP  | 0 |  ExcCode  |  0


 IP[1:0]  Controls the request for software interrupts

In your example with 0x100, that means that only IP0 (bit 8) of the cause register is set, which means that the cause was a software interrupt request (software interrupt 0 to be specific).

answered on Stack Overflow Feb 15, 2016 by Michael

User contributions licensed under CC BY-SA 3.0