📄 8.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>中断 Exceptions(interrupts) </title>
<meta name="Microsoft Theme" content="arcs 011">
<meta name="Microsoft Border" content="none">
</head>
<body background="../images/arctile.jpg" bgcolor="#FFFFFF" text="#000000" link="#3399FF" vlink="#666666" alink="#FF9900">
<p align="center"><font color="#000000" size="6"><b>5.8 中断 Exceptions(interrupts)
</b></font></p>
<p align="right"><font color="#000000"><a href="index.htm"><img border="0" src="Image/BACK.GIF" align="left" width="60" height="45"></a><a href="7.htm"><img border="0" src="Image/PREV.GIF" width="60" height="45"></a>
<a href="../chapter7/Index.htm"><img border="0" src="Image/FORW.GIF" width="60" height="45"></a></font></p>
<p><font color="#000000" size="4"><b>最具挑战性的工作是处理器设计中的控制器的设计</b></font></p>
<p><font color="#000000" size="4"><b>1)做到完全正确难</b></font></p>
<p><font color="#000000" size="4"><b>2)提高速度难</b></font></p>
<p><font color="#000000" size="4"><b>控制器中最难设计的部分是中断系统的设计</b></font></p>
<p><font color="#000000" size="4"><b>一。概述</b></font></p>
<p><font color="#000000" size="4"><b>1) trap ----- 软中断</b></font></p>
<p><font color="#000000" size="4"><b> Exception ----- 内中断</b></font></p>
<p><font color="#000000" size="4"><b> Interrupt ------ 外中断</b></font></p>
<p><font color="#000000" size="4"><b>中断的概念:出现了引起控制流改变的不可预料的事件。</b></font></p>
<p> </p>
<p><font color="#000000" size="4"><b>2)中断的分类</b></font></p>
<p><font color="#000000" size="4"><b>内中断:处理器内部的异常事件:溢出,除数0,指令错</b></font></p>
<p><font color="#000000" size="4"><b>外中断:I/O设备请求处理器处理输入输出的事件</b></font></p>
<p><font color="#000000" size="4"><b>3)计算机中引起中断的实例</b></font></p>
<table border="1" width="100%" bordercolordark="#CC9966" bordercolorlight="#FFCC66">
<tr>
<td width="33%" align="center"><font color="#000000" size="4"><b>Type of event</b></font></td>
<td width="33%" align="center"><font color="#000000" size="4"><b>From where</b></font></td>
<td width="34%" align="center"><font color="#000000" size="4"><b>MIPS terminology</b></font></td>
</tr>
<tr>
<td width="33%" align="center"><font color="#000000" size="4"><b>I/O device request </b></font></td>
<td width="33%" align="center"><font color="#000000" size="4"><b>External</b></font></td>
<td width="34%" align="center"><font color="#000000" size="4"><b>interrupt</b></font></td>
</tr>
<tr>
<td width="33%" align="center"><font color="#000000" size="4"><b>Invoke the operating system form user
program</b></font></td>
<td width="33%" align="center"><font color="#000000" size="4"><b>internal</b></font></td>
<td width="34%" align="center"><font color="#000000" size="4"><b>Exception</b></font></td>
</tr>
<tr>
<td width="33%" align="center"><font color="#000000" size="4"><b>Arithmetic overflow</b></font></td>
<td width="33%" align="center"><font color="#000000" size="4"><b>internal</b></font></td>
<td width="34%" align="center"><font color="#000000" size="4"><b>Exception</b></font></td>
</tr>
<tr>
<td width="33%" align="center"><font color="#000000" size="4"><b>Using an undefined instruction </b></font></td>
<td width="33%" align="center"><font color="#000000" size="4"><b>internal </b></font></td>
<td width="34%" align="center"><font color="#000000" size="4"><b>Exception</b></font></td>
</tr>
<tr>
<td width="33%" align="center"><font color="#000000" size="4"><b>hardware malfunctions</b></font></td>
<td width="33%" align="center"><font color="#000000" size="4"><b>Either</b></font></td>
<td width="34%" align="center"><font color="#000000" size="4"><b>Exception or interrupt</b></font></td>
</tr>
</table>
<p><font color="#000000" size="4"><b>二。中断的处理</b></font></p>
<p><font color="#000000" size="4"><b>1)分析中断的原因以及是执行哪条指令引起的中断。</b></font></p>
<p><font color="#000000" size="4"><b>2)进行服务的处理(相当于调用一个服务的子进程)。</b></font></p>
<p><font color="#000000" size="4"><b>3)返回被中断的程序,继续或是终止程序。</b></font></p>
<p><font color="#000000" size="4"><b>对此中断要有支持</b></font></p>
<p><font color="#000000" size="4"><b>1)保护断点</b></font></p>
<p><font color="#000000" size="4"><b>2)分析中断的原因</b></font></p>
<p> </p>
<p><font face="黑体" color="#000000" size="4"><b>三。中断的检测---有否中断发生?</b></font></p>
<p><font face="黑体" color="#000000" size="4"><b>1)在状态1检测指令操作码</b></font></p>
<p><font face="黑体" color="#000000" size="4"><b>2)在状态7时检测OVERFLOW=1(YES的话,置STATE11)</b></font></p>
<p><font face="黑体" color="#000000" size="4"><b>i)pc-4=>EPC</b></font></p>
<p><font face="黑体" color="#000000" size="4"><b>j)中断矢量地址=>pc</b></font></p>
<p><font color="#000000" size="4"><b> <font face="黑体">a)PCSOURCE=11</font></b></font></p>
<p><font color="#000000" size="4"><b> <font face="黑体">b)常数值</font></b></font></p>
<p><font face="黑体" color="#000000" size="4"><b>修改硬件,使之符合中断的要求</b></font></p>
<p><font face="黑体" color="#000000" size="4"><b>我们在这里只是简单的看一下中断的状态转移,关于中断的具体的解释,请参考第8章</b></font></p>
<p><font color="#000000" size="4"><img border="0" src="Image/8-1.gif" width="512" height="615"></font></p>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -