问题描述
如何从给定数据中找到段地址?
物理地址 = 0x119B,有效地址 = 0x10AB
公式是什么?
x86 16 位实模式中的有效地址只是 20 位 segment:offset 地址.给你的问题是确定一个段值,当与有效地址 0x10AB 结合产生一个物理(线性)地址 0x119B 时.
物理地址可以从 segment:offset 对使用公式 physaddr=(segment< 或
physaddr=(段*0x10)+偏移量
.稍微修改一下公式:
physaddr = (segment*0x10)+offsetphysaddr-offset = 段*0x10(physaddr-offset)/0x10 = 段段 = (physaddr-offset)/0x10
既然我们知道段的公式是segment = (physaddr-offset)/0x10
,我们可以执行计算来找到您问题的答案:
segment = (0x119B-0x10AB)/0x10段 = 0xF0/0x10段 = 0xF
我们可以通过将它代入物理地址的原始方程来检查这个结果并得到:
physaddr = (0xF*0x10)+0x10AB = 0x119B.
how to find a segment address from given data?
Physical address = 0x119B, Effective address = 0x10AB
what could be the formula?
The effective address in x86 16-bit real mode is just the offset portion of a 20-bit segment:offset address. The question you have been given is to determine a segment value when combined with the effective address 0x10AB yields a physical (linear) address of 0x119B.
The physical address can be computed from a segment:offset pair with the formula physaddr=(segment<<4)+offset
or physaddr=(segment*0x10)+offset
. Reworking the formula a bit:
Now that we know the formula for segment is segment = (physaddr-offset)/0x10
we can perform the calculation to find the answer for your question:
We can check this result by plugging it into the original equation for physical address and get:
这篇关于从给定的物理地址和有效地址中查找段地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!