x86分段内存 [英] x86 Segmented Memory

查看:93
本文介绍了x86分段内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前几天,在阅读大会的艺术时,我来到此处有关内存布局。它开始讨论分段内存,但我认为这没有什么意义。

While reading The Art of Assembly the other day, I came to the section here on memory layout. It started discussing segmented memory, and I didn't think it made a lot of sense.

将内存拆分为分段是组织的一种完美方式,但是使用函数 segment + offset ,当函数重复其输出时您会怎么做?例如 1038 + 57 57 + 1038 1095 + 0 全部都出现在线性地址1095中。这不是一件坏事吗?

Splitting memory into segments makes perfect sense as a way for organization, but using the function segment + offset, what do you do when the function repeats its outputs? e.g. 1038 + 57, 57 + 1038, and 1095 + 0 all come out to the linear address 1095. Isn't that a bad thing? Wouldn't you accidentally address the same linear memory space when you didn't mean to?

维基百科说,它可以被用来作为一种优势,例如,当处理多个嵌套数据结构,但是如何用它更快地解决嵌套结构?

Wikipedia says it can be used to an advantage, "for example when addressing multiple nested data structures," but how is this be used to address nested structures quicker?

推荐答案

您错过了文本的重要部分这些地址是如何计算的。

You missed an important part of the text how these address are calculated.

在8086、8088、80186和80188(以及其他在实模式下运行的处理器)上,将段映射到物理地址的功能非常简单。 CPU将段值乘以十六(10h),然后加上偏移量部分。

On the 8086, 8088, 80186, and 80188 (and other processors operating in real mode), the function that maps a segment to a physical address is very simple. The CPU multiplies the segment value by sixteen (10h) and adds the offset portion.

并且不要忘记这些地址始终以十六进制计算系统。

And dont forget that these addresses are always calculated in hexadecimal system.

这篇关于x86分段内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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