x86 Segmented Memory

风流意气都作罢 提交于 2020-07-10 05:42:38

问题


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.

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?


回答1:


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

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.



来源:https://stackoverflow.com/questions/18264979/x86-segmented-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!