I am a little confused with the use of colon in x86 assembly. I know that in real mode %gs:0x14
will be the address of %gs
shift 4 bits left and adds with 0x14
. But it is the same in protected mode? For example in protected mode,
movl %gs:0x14 %eax
In what way %gs:0x14
is accessed? It is like 0x14(%gs)
or same as in real mode?
Update:
to make my question clearer, assume %gs = 0x1234
what is the value of %eax after instruction movl %gs:0x14 %eax
.
Further information:
Just found this document useful for the function of gs and fs in different system
http://www.akkadia.org/drepper/tls.pdf
And this link provide information about segment:offset address.
http://thestarman.pcministry.com/asm/debug/Segments.html
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…