问题描述
计算代码段的十六进制字节大小的正确方法是什么?我得到:
pre code> IP = 0848 CS = 1488 DS = 1808 SS = 1C80 ES = 1F88
我正在研究的练习题要求代码段的大小(以十六进制字节为单位),并给出以下选择: p>
A。 3800 B. 1488 C. 0830 D. 0380 E.以上都不是
正确答案是A 。3800,但我不知道该如何计算。
解决方案计算代码段的十六进制字节大小的正确方法是什么?我得到:
pre code> IP = 0848 CS = 1488 DS = 1808 SS = 1C80 ES = 1F88
我正在研究的练习题要求代码段的大小(以十六进制字节为单位),并给出以下选择: p>
A。 3800 B. 1488 C. 0830 D. 0380 E.以上都不是
正确答案是A 。3800,但我不知道该如何计算。
解决方案如何计算长度: p>
在您的示例中,DS最接近。 1808 - 1488 == 380.和380 x 10 = 3800。
顺便说一下,这只适用于8086和其他类似骨头的CPU,并且在x86上处于实模式。在x86上的保护模式下(也就是说,除非你正在编写引导扇区或简单的DOS程序),段寄存器的值与段的大小无关,因此上面的内容只是简单的不适用。
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.
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.
这篇关于以十六进制字节计算大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!