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: 20630
Location: In your JS exploiting you and your system
revolution 20 Apr 2006, 06:24
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 25 Apr 2006, 00:00
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 25 Apr 2006, 06:40
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 25 Apr 2006, 06:56
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: 8394
Location: Kraków, Poland
Tomasz Grysztar 25 Apr 2006, 09:26
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 26 Apr 2006, 09:45
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 26 Apr 2006, 16:21
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.