计算大小(以十六进制字节为单位)
计算代码段的十六进制字节大小的正确方法是什么。我得到:
IP = 0848 CS = 1488 DS = 1808 SS = 1C80 ES = 1F88
我正在进行的练习询问代码段的大小(以十六进制字节为单位)并给出以下选择:
A. 3800 B. 1488 C. 0830 D. 0380 E. none of the above
正确答案是 A.3800,但我不知道如何计算这。
what is the proper way to calculate the size in hex bytes of a code segment. I am given:
IP = 0848 CS = 1488 DS = 1808 SS = 1C80 ES = 1F88
The practice exercise I am working on asks what is the size (in hex bytes) of the code segment and gives these choices:
A. 3800 B. 1488 C. 0830 D. 0380 E. none of the above
The correct answer is A. 3800, but I haven't a clue as to how to calculate this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何计算长度:
在您的示例中,DS 最接近。 1808 - 1488 == 380。并且 380 x 10 = 3800。
顺便说一句,这只适用于 8086 和其他类似的愚蠢的 CPU,并且在 x86 上的实模式下。在 x86 的保护模式下(也就是说,除非您正在编写引导扇区或简单的 DOS 程序),段寄存器的值与段的大小几乎没有关系,因此上面的内容只是不适用。
How to calculate the length:
In your example, DS is closest. 1808 - 1488 == 380. And 380 x 10 = 3800.
BTW, this only works on the 8086 and other, similarly boneheaded CPUs, and in real mode on x86. In protected mode on x86 (which is to say, unless you're writing a boot sector or a simple DOS program), the value of the segment register has very little to do with the size of the segment, and thus the stuff above simply doesn't apply.