📄 onintr.htm
字号:
<title>The onintr Library Function</title><h1 align=center>The onintr Library Function</h1><!--INDEX "Installing assembly language exception handlers" --><!--INDEX onintr --></dl><h2>NAME</h2><dl><dd> onintr - connect exception handler</dl><h2>SYNOPSIS</h2><dl><dd><pre>onintr (EXCCODE,handler)</pre></dl><h2>DESCRIPTION</h2><dl><dd> onintr connects an assembly language execption handler to a selected EXCCODE in the CAUSE register, refer the LR33000 for a list of EXCCODE values. This function is only available for programs running under PMON.<p> When control is passed to the handler, the first element of the array, whose address was passed during the onintr() call, will contain a pointer to another similar array. Therefore, if the handler decides that it doesn't want to handle this exception after all, it can pass control to the next exception handler in the list.<p></dl><h2>EXAMPLE</h2><dl><dd><pre> typedef int iFunc(); int hwint(); iFunc *dat1[] = {0,hwint}; main() { onintr(0,dat1); .... } .globl hwint .ent hwint .set noat .set noreorder hwint: # ignore non INT0 exceptions mfc0 k0,C0_CAUSE nop .set reorder sll k0,21 # move INT0 to MSB bltz k0,1f # branch if MSB set # if not, return to PMON la k0,dat1 lw k0,(k0) lw k0,4(k0) j k0 # return to PMON1: ..... User's handler ..... # return to interrupted program .set noreorder mfc0 k0,C0_EPC nop j k0 rfe .set reorder .set at .end hwint</pre>For a complete example, see <a href="../../examples/pmon/onintr.c">onintr.c</a>and <a href="../../examples/pmon/tisr.s">tisr.s</a>.<p></dl><p><hr><b>Navigation:</b> <a href="../index.htm">Document Home</a> | <a href="../doctoc.htm">Document Contents</a> | <a href="../docindex.htm">Document Index</a> <p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -