flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Produces opcode for "pop cs"

Author
Thread Post new topic Reply to topic
Dasn



Joined: 22 Nov 2004
Posts: 10
Dasn
Hi,
According to Intel's manual, I think "pop cs" is an illegal instruction.
But in some circumstance, fasm will generate bytes for "pop cs" other than report an error.

The following 3 test codes show this problem:

Code:
format binary
use16
pop cs
    


Code:
format MZ
use16
pop cs
    


Code:
format MZ
use32

segment main
pop cs
    
Post 22 Aug 2009, 13:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
This has been discussed before, I can't find right now, but basically there are some old processors that do have a pop cs instruction (0x0f).

Although your example of use32/pop cs is a little troubling, any 32bit capable CPU won't have pop cs.

[edit]
I found one topic discussing it.
http://board.flatassembler.net/topic.php?t=5132
[edit2]
And another.
http://board.flatassembler.net/topic.php?t=4754
Post 22 Aug 2009, 13:49
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
Post 22 Aug 2009, 15:35
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.