Well acording to IA 32 manual this should look like this:

Segment register CS,DS, ES
000 sreg2 111
and CS is 01 in this case
so it should look like this:
000 01 111
and that is 0F (2 byte long opcode)
and segment registers FS, GS should be encoded as:
0000 1111? 10 sreg3 001...
Is it possible that IA32 manual is wrong on this issue, or such instruction doesn't exist or is it encoded as 2 byte long opcode?

Any help would be appriciate, thanks

Best regards...
Posted on 2005-03-14 10:01:27 by deroko
segment fs and gs were added later so they were encoded as 2byte opcodes (those opcodes that begins with 0fh)
Posted on 2005-03-14 10:56:33 by roticv
nah I asked about pop cs because it should be, acording to IA32 manual, assembled as 000 01 111b and that is 0F (0F 2 byte opcode), so I'm not sure if? IA32 manual is wrong on this issue b/c it is imposible that pop cs is 0F, it has to be something else
It might be assembled as 2byte opcode and that is the only normal solution, or maybe such instruction doesn't exist :(

Posted on 2005-03-14 11:50:36 by deroko
My applogies for misunderstanding you.

pop cs does not exist
Posted on 2005-03-14 12:02:27 by roticv
thanks :)
Posted on 2005-03-14 14:18:40 by deroko
In Volume 2, it is explicitly mentioned:
"The POP instruction cannot pop a value into the CS register. To load the CS register from the stack, use the RET instruction."

It might have been because of what you found.  :)
Posted on 2005-03-14 16:15:08 by Starless
POP CS is DB 0Fh
But it is supported only by 8086.
So it's now used as a prefix for 2 bytes opcode.
Posted on 2005-03-14 16:45:58 by BJZ

In Volume 2, it is explicitly mentioned:
"The POP instruction cannot pop a value into the CS register. To load the CS register from the stack, use the RET instruction."

It might have been because of what you found.? :)


ahhh :( I didn't see that :)
Posted on 2005-03-14 17:21:22 by deroko