远近JMP [英] Near and Far JMPs

查看:73
本文介绍了远近JMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在进行Linux汇编,并且我知道它具有平面内存模型.我感到困惑的是NEAR和FAR JMP.

I am doing Linux assembly and I understand that is has a flat memory model. What I am confused about is NEAR and FAR JMPs.

NEAR在同一段中,而FAR在另一段中.据我了解,Linux虚拟内存中没有段?另外,我们如何知道我的程序的代码是否布置在多个段中?

NEAR is in the same segment while FAR is another segment. From what I understand there are no segments in linux virtual memory? Also how do we know if my program's code is laid out in multiple segments?

推荐答案

现在已经很久没有细分了.在保护模式x86中,正确的术语是选择器.

It hasn't been segments for a long time now. The correct term in protected mode x86 is selector.

话虽如此,近跳和远跳之间的区别在于前者保持相同的代码选择器cs,而后者通常改变它.

Having said that, the difference between a near jump and a far one is that the former maintains the same code selector cs while the latter (usually) changes it.

在平面内存模型中,前一种情况几乎总是如此.

In a flat memory model, the former case is almost always how it's done.

可以有一个操作系统,其中多个选择器为平面内存模型提供服务,但我看不到有用的用例,而且这不是Linux的工作方式,至少在x86.

You could have an operating system where the flat memory model is served by multiple selectors but I can't see a useful use case for it, and it's not the way Linux works, at least on x86.

这篇关于远近JMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆