proc far and near. 的简单解释

来源:互联网 发布:广东网络干部学院登录 编辑:程序博客网 时间:2024/05/29 12:52

There are two types of CALLS and JMPS in 16-bit assembly: near and far.

在16位汇编中有两种类型的CALLS和JMPS:near和far。

Near contains a 16-bit offset. For calls it will save the IP only.
Far contains a segment and a 16-bit offset. For calls it will save IP and CS.

Near包含一个16位的偏移量。对于通话,它将只保存IP。
Far包含一个段和一个16位偏移量。对于通话它将保存IP和CS。

Defining a proc as FAR tells the assembler that all Calls to that proc must give both a segment and a 16-bit offset. The upshot of this is that the FAR Call will save both IP and CS. There are two variants of RET: RETN and RETF. One will pull off IP and the other will pull of BOTH IP AND CS. Go figure which one, okay?

定义一个proc为FAR告诉汇编程序,该proc的所有调用都必须给出一个段和一个16位偏移量。这样做的结果是FAR呼叫将保存IP和CS。 RET有两种变体:RETN和RETF。一个将拉动IP,另一个将拉动IP和CS。去判断你的是哪一个,ok?

“Information has a tendency to be free. Which means someone will always tell you something you don’t want to know.”

原创粉丝点击