简体   繁体   中英

What is the advantage of using segment registers (today)?

i was trying quite a while to learn what the segment registers purpose is? I All ready know that this comes from the past (8086) where there was only 1 MByte of physical memory. But the CPU's had only 16 Bit wide address registers. With these 16 Address bits you could only address 64K Byte. So the 1MByte Address-space had to be separated into segments each of 64K size.

This seems to me to be a requirement from the past where those engineers hat to work around of somehow limited memory space and such. But my question is what is the advantage of the segment registers today? How or where would you use them registers in a useful way? If you need clarification just comment.

Read about the Flat Model .

Segment Register today mostly serve as legacy for backward compatibility (except FS-GS as mentioned by @Jester)

Arguably, x86-64 long mode is the technology of "today". There classical segmentation for the most part is nonexistent, with only FS and GS being used for practical purposes. FS is typically used for various thread-local and system data in user mode, while GS is used for kernel mode. This latter use is supported by the SWAPGS instruction.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM