English 中文(简体)
MIPS assembly to determine whether hardware I/O interrupt has occurred?
原标题:

In my MIPS32 exception handler, I want to determine whether the exception was caused by a I/O interrupt. The Cause register bits 2-6 inclusive has to be checked. What s the MIPS assembly code to determine this?

问题回答

You have to mask out each bit to check where the interrupt came from. The exception handler procedure is shown here: ExcHandler You can see the manual for your hardware that says where the interrupt came from and theres often error codes that u can load into a register and compare with the EPIE register to see if the exception was a trap or interrupt, remember to reset the EPIE (error status register) before you return from the error and enable the interrupt bits in the processors control register to allow the hardware to make interrupts.

This is the scheme i used when coding an exception handler for Nios II, the procedure should be similar for MIPS32.

MIPS assembly language, MIPS: Interrupts and Exceptions page 22





相关问题
List of suspected Malicious patterns

I am doing an anti-virus project by disassembling its code and analyzing it. So I want a list of the Suspected Malicious pattern codes, so I can observe which is suspected and which is not? So I want ...

Prefetch for Intel Core 2 Duo

Has anyone had experience using prefetch instructions for the Core 2 Duo processor? I ve been using the (standard?) prefetch set (prefetchnta, prefetcht1, etc) with success for a series of P4 ...

How are mutex and lock structures implemented?

I understand the concept of locks, mutex and other synchronization structures, but how are they implemented? Are they provided by the OS, or are these structures dependent on special CPU instructions ...

Installing GNU Assembler in OSX

No matter how hard I google, I can t seem to find a (relatively) easy-to-follow instruction on how to install the GNU Assembler on a mac. I know I can use gcc -c (Apple Clang on a Mac) to assemble .s ...

8086 assembler,INT 16,2

I got stuck at this thing,I want to see if right shift button has been pressed,so I have this assambler code: mov ah,2 int 16h ;calling INT 16,2 - Read Keyboard Flags interrupt mov ah,...

Translate a FOR to assembler

I need to translate what is commented within the method, to assembler. I have a roughly idea, but can t. Anyone can help me please? Is for an Intel x32 architecture: int secuencia ( int n, ...

热门标签