实模式内存寻址中的段和偏移量是多少? [英] What are the segment and offset in real mode memory addressing?

查看:28
本文介绍了实模式内存寻址中的段和偏移量是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读有关内存寻址的信息.我阅读了段偏移,然后阅读了描述符偏移.我知道如何在实模式下计算确切地址.所有这些都可以,但我无法理解偏移量到底是什么?我读到的任何地方:

I am reading about memory addressing. I read about segment offset and then about descriptor offset. I know how to calculate the exact addresses in real mode. All this is OK, but I am unable to understand what exactly offset is? Everywhere I read:

在实模式下,寄存器只有 16 位,所以你只能寻址高达 64k.为了允许寻址更多的内存,地址是由 segment * 16 + offset 计算.

In real mode, the registers are only 16 bits, so you can only address up to 64k. In order to allow addressing of more memory, addresses are calculated from segment * 16 + offset.

这里我可以理解第一行.我们有 16 位,所以我们最多可以寻址 2^16 = 64k.

Here I can understand the first line. We have 16 bits, so we can address up to 2^16 = 64k.

但是第二行是什么?段代表什么?为什么我们乘以 16?为什么我们添加偏移量.我就是不明白这个偏移是什么?任何人都可以解释我或给我链接吗?

But what is this second line? What the segment represent? Why we multiply it with 16? why we add offset. I just can't understand what this offset is? Can anybody explain me or give me link for this please?

推荐答案

在 x86 实模式内存下,物理地址为 20 位长,因此计算如下:

Under x86 Real-Mode Memory the physical address is 20 bit long and is therefore calculated as:

PhysicalAddress = Segment * 16 + Offset

另请检查:实模式内存管理

这篇关于实模式内存寻址中的段和偏移量是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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