📄 8.2.2b.htm
字号:
<html>
<head>
<title>编译原理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link type="text/css" rel="stylesheet" href="../css/specification.css">
</head>
<body>
<table align=right width=300>
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='8.2.2.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='8.2.2c.htm'"></img></td>
</tr>
</table>
<br><br>
<table><tr><td>    </td>
<td class="content">
属性caller.recordsize代表一个活动记录的大小,因此ADD指令将SP指向下一个活动记录的开始位置。MOV指令中的源#here+16是接在GOTO指令之后的地址值,它被存放在SP所指示的单元中。</P>
<P>返回序列包括两个部分。第一部分,被调用过程采用如下GOTO指令将控制返回到调用过程:
<P align=left>
GOTO *0(SP)<font color="#008000">/*返回到调用过程*/</font><br>
在GOTO指令中使用*0(SP)的原因是,0(SP)是被调用过程的活动记录中的第一个字,而*0(SP)是存放在0(SP)中的返回地址。
<P>返回序列的第二部分是在调用过程中,它给予SP一个减量,从而将SP恢复为原来的值,即相减后SP指向调用过程的活动记录的开始位置:
<P align=left>
SUB #caller.recordsize,SP</P>
<P>关于调用序列的进一步讨论请参阅6.3节。</P>
</td></tr></table>
<p>
<table align=right width=300>
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='8.2.2.htm'"></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='8.2.2c.htm'"></img></td>
</tr>
</table>
</BODY>
</html>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -