MASM32 “默认代码距离是什么意思”?

发布于 2024-08-12 03:18:42 字数 110 浏览 4 评论 0原文

MASM32 中使用的符号:

@CodeSize 返回表示默认代码距离的整数。

我想了解“默认代码距离”是什么意思?

托尼

This symbol used in MASM32:

@CodeSize Returns an integer representing the default code distance.

I'm trying to understand what 'default code distance' means?

Tony

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乙白 2024-08-19 03:18:42

默认代码距离为 NEAR 或 FAR。

@CodeSize 可以采用两个值,0 或 1,这决定了跳跃、调用等距离是近还是远。

如果您使用 TINY、SMALL、COMPACT 或 FLAT 内存模型,则所有跳转等都是 NEAR,并且 @CodeSize == 0。
如果您使用 HUGE、LARGE、MEDIUM 内存模型,则 als 跳转等为 FAR 并且 @CodeSize == 1。

The default code distance is either NEAR or FAR.

@CodeSize can take two values, either 0 or 1, which determines if jumps, calls etc. are in NEAR or FAR distance.

If you are using the TINY, SMALL, COMPACT or FLAT memory model, all jumps etc. are NEAR, and @CodeSize == 0.
If you are using the HUGE, LARGE, MEDIUM memory model, als jumps etc. are FAR and @CodeSize == 1.

晨与橙与城 2024-08-19 03:18:42

很可能是两个最远的代码之间的最大距离(以字节为单位,在内存中)。这可能会影响跳转的生成方式,因为可能存在具有不同跳转长度的不同指令。可以用更短(更小,通常更快)的指令来编码更短的跳转。

此页面提到了可以使用哪些整数值预计:

0 代表微小、小型、紧凑和扁平
型号,1 个用于中型、大型和
巨大的模型(数字相等)。

Very probably the maximum distance (in bytes, in memory) between the two most distant pieces of code. This might influence how jumps are generated, since there can be different instructions capable of different jump lengths. A shorter jump can be encoded with a shorter (smaller, often faster) instruction.

This page mentions what integer values one can expect:

0 for TINY, SMALL, COMPACT, and FLAT
models, and 1 for MEDIUM, LARGE, and
HUGE models (numeric equate).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文