1.htm

来自「浙江大学计算机学院计算机组成教材《计算机组成与设计》(潘学增)的课堂教学课件。」· HTM 代码 · 共 201 行 · 第 1/2 页

HTM
201
字号
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>指令简介 </title>


<script language="JavaScript" fptype="dynamicanimation">
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language="JavaScript1.2" fptype="dynamicanimation" src="animate.js">
</script>
<meta name="Microsoft Theme" content="arcs 011">
<meta name="Microsoft Border" content="none">
</head>

<body onload="dynAnimation()" background="arctile.jpg" bgcolor="#FFFFFF" text="#000000" link="#3399FF" vlink="#666666" alink="#FF9900">

<p align="center"><strong><font color="#000000"><big><big><big>3.1&nbsp;&nbsp;&nbsp;&nbsp; </big></big></big><font size="6">指令简介</font></font></strong></p>  
  
<p align="right"><font color="#000000"><a href="index.htm"><img border="0" src="../images/back.gif" align="left" width="60" height="45"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       
<a href="2.htm"><img border="0" src="../images/forw.gif" width="60" height="45"></a></font></p>      
      
<p><strong><font color="#000000"><font size="4">本节重要知识主要是</font>:<a href="#MIPS operands">MIPS operands</a> and        
<a href="#MIPS assembly language">MIPS assembly language</a></font></strong></p>       
       
<p><strong><font color="#000000" size="4">与计算机说话,必须用它的语言,机器的语言称为指令(<em>Instructions</em>).</font></strong></p>      
      
<p><strong><font color="#000000" size="4">指令的集合称为指令系统(<em>Instructions set</em>).</font></strong></p>      
      
<p><strong><font color="#000000" size="4">本章主要用C语言及MIPS对照介绍<em>Instructions set</em>.</font></strong></p>        
        
<p dynamicanimation="fpAnimflyBottomRightWordFP1" style="position: relative !important; visibility: hidden" id="fpAnimflyBottomRightWordFP1" language="Javascript1.2"><strong><font color="#000000" size="4">计算机硬件设计的四大原则:</font></strong></p>      
      
<ol style="color: #800000">      
  <li style="color: #800000"><strong><font color="#000000" size="4"><img border="0" src="../images/sub.gif" width="26" height="27">规整化简化硬件 (<em>Simplicity favors regularity</em>);</font></strong></li>        
  <li><strong><font color="#000000" size="4"><img border="0" src="../images/sub.gif" width="26" height="27">越小越快&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (<em>Smaller is faster</em>);</font></strong></li>        
  <li><strong><font color="#000000" size="4"><img border="0" src="../images/sub.gif" width="26" height="27">综合考虑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (<em>Good design demands         
    compromise</em>);</font></strong></li>        
  <li><strong><font color="#000000" size="4"><img border="0" src="../images/sub.gif" width="26" height="27">常用的要速度快 (<em>Make the common case fast</em>).</font></strong></li>        
</ol>        
        
<p><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<big>&nbsp;<strong><img border="0" src="../images/sub.gif" width="26" height="27"> <a name="MIPS operands">MIPS operands</a>(</strong></big></font><strong><font color="#000000"><big>操作</big>数)</font></strong></p>       
       
<table border="1" width="100%" height="65" bordercolordark="#CC9966" bordercolorlight="#FFCC66">       
  <tr>       
    <td width="16%" height="15" bgcolor="#008000"><strong><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp; Name</font></strong></td>        
    <td width="25%" height="15" bgcolor="#008000"><strong><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;         
    Example</font></strong></td>        
    <td width="59%" height="15" bgcolor="#008000"><strong><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;         
    comments</font></strong></td>        
  </tr>        
  <tr>        
    <td width="16%" height="16"><strong><font color="#000000">32&nbsp; registers</font></strong></td>        
    <td width="25%" height="16"><strong><font color="#000000">&nbsp;&nbsp; $0,$1,$2......#31</font></strong></td>        
    <td width="59%" height="16"><strong><font color="#000000">Fast locations for data.In MIPS,data must be in         
    registers to perform</font></strong><p><strong><font color="#000000">arithmetic.MIPS register $0 always equals 0.</font></strong></td>        
  </tr>        
  <tr>        
    <td width="16%" height="16"><strong><font color="#000000">2^30 memory words</font></strong></td>        
    <td width="25%" height="16"><strong><font color="#000000">&nbsp; Memory[0],</font></strong><p><strong><font color="#000000">&nbsp;         
    Memory[4]......</font></strong></p>        
    <p><strong><font color="#000000">Memory[4294967292]</font></strong></td>      
    <td width="59%" height="16"><strong><font color="#000000">Accessed only by data transfer instructions in         
    MIPS.MIPS uses</font> </strong><p><strong><font color="#000000">byteaddresss,so sequential words differ by 4.Memoty         
    holds data</font> </strong></p>        
    <p><strong><font color="#000000">structures, such as arrays, and spilled registers.</font> </strong></td>        
  </tr>        
</table>        
        
<p><font color="#000000"> </font></p>

<p><strong><font color="#000000" size="4">现代的计算机都是建立在下面两条基本原则之上:</font></strong></p>

<ol>
  <li style="color: #800000"><strong><font color="#000000" size="4"><img border="0" src="../images/sub.gif" width="26" height="27">指令以数字表达        
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;         
    (<em>Instructions are represented as numbers</em>);</font></strong></li>        
  <li style="color: #800000"><strong><font color="#000000" size="4"><img border="0" src="../images/sub.gif" width="26" height="27">程序存储在内存中象数字一样被读写&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        
    (<em>Programs can be stored in memory to be read or written just like</em> <em>numbers</em>).</font></strong></li>        
</ol>        
        
<p><strong><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img border="0" src="../images/sub.gif" width="26" height="27"> <big><a name="MIPS assembly language">MIPS assembly language</a></big></font></strong></p>        
        
<table border="1" width="100%" bordercolordark="#CC9966" bordercolorlight="#FFCC66">        
  <tr>        
    <td width="9%" bgcolor="#008000"><strong><font color="#000000">Category</font></strong></td>      
    <td width="13%" bgcolor="#008000"><strong><font color="#000000">Instruction</font></strong></td>      
    <td width="22%" bgcolor="#008000"><strong><font color="#000000">Example</font></strong></td>      
    <td width="29%" bgcolor="#008000"><strong><font color="#000000">Meaning</font></strong></td>      
    <td width="27%" bgcolor="#008000"><strong><font color="#000000">Comments</font></strong></td>      
  </tr>      
  <tr>      
    <td width="9%" rowspan="3"><strong><font color="#000000">Arithmetic</font></strong></td>      
    <td width="13%"><strong><font color="#000000">add</font></strong></td>      
    <td width="22%"><strong><font color="#000000">add&nbsp;&nbsp;&nbsp; $1,$2,$3</font></strong></td>        
    <td width="29%"><strong><font color="#000000">$1=$2+$3</font></strong></td>      

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?