flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [bug]Bad code generated for POP CS

Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
Bad code generated for POP CS

Generates 0F 00

I am wondering whether FASM should generate 0F or give an error? I much prefer to get an error even though the original 8086 will actually pop cs.

Opinions?
Post 20 Apr 2006, 06:24
View user's profile Send private message Visit poster's website Reply with quote
TDCNL



Joined: 25 Jan 2006
Posts: 56
TDCNL
Code:
POP - Pop Word off Stack

        Usage:  POP     dest
        Modifies flags: None

        Transfers word at the current stack top (SS:SP) to the destination
        then increments SP by two to point to the new stack top.  CS is not
        a valid destination.    


I've just looked this up, but why CS is not valid destination and why FASM assembles as "0F 00" I don't know, maybe Tomasz Grysztar should comment us some on 'POP CS' Very Happy

_________________
:: The Dutch Cracker ::
Post 25 Apr 2006, 00:00
View user's profile Send private message Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
CS is a valid destination only in 8086 procesor.
Post 25 Apr 2006, 06:40
View user's profile Send private message Visit poster's website Reply with quote
TDCNL



Joined: 25 Jan 2006
Posts: 56
TDCNL
MazeGen wrote:
CS is a valid destination only in 8086 procesor.


And above too?

_________________
:: The Dutch Cracker ::
Post 25 Apr 2006, 06:56
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7801
Location: Kraków, Poland
Tomasz Grysztar
POP CS is now allowed only with USE16.
Post 25 Apr 2006, 09:26
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
TDCNL: I meant it is valid only in 8086 and 8088 and invalid in 186 and later ones.
Post 26 Apr 2006, 09:45
View user's profile Send private message Visit poster's website Reply with quote
TDCNL



Joined: 25 Jan 2006
Posts: 56
TDCNL
MazeGen wrote:
TDCNL: I meant it is valid only in 8086 and 8088 and invalid in 186 and later ones.


Thanks for reply, now I understand clearly Very Happy

_________________
:: The Dutch Cracker ::
Post 26 Apr 2006, 16:21
View user's profile Send private message 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.