简体   繁体   中英

Do Segment Registers change at runtime?

Can the Segment Registers change during execution of a program? I am sure it is possible to change them in assembly, but if I write in c or c++ and compile, and have a few inline asm instructions, can I count on the SS register and other segment registers to stay unchanged?

If you are under a typical 32 or 64 bit operating system then you can pretty much ignore segment registers (except when dealing with thread-local storage, exception handling or system stuff). CS , DS , ES and SS all address the same memory and they don't change. Compilers assume this as well.

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