flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Opcode fsub

Author
Thread Post new topic Reply to topic
dmitriy566



Joined: 19 Jun 2012
Posts: 25
Location: Saint-Petersburg, Russia
dmitriy566 03 Jul 2012, 12:09
Hello!
When i insert only one command fsub in work code, fasm says:"invalid operand". With fsubp it works ok. I think that it is a bug.
Post 03 Jul 2012, 12:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20401
Location: In your JS exploiting you and your system
revolution 03 Jul 2012, 12:28
If you read the Intel manual it states that fsub (without the p) must have either a memory operand or two st() operands, and that fsubp has no operands.

If you want to call it a bug then you need to talk to Intel about it.
Post 03 Jul 2012, 12:28
View user's profile Send private message Visit poster's website Reply with quote
dmitriy566



Joined: 19 Jun 2012
Posts: 25
Location: Saint-Petersburg, Russia
dmitriy566 03 Jul 2012, 15:09
Ok, if i write fsub st,st(1) , fasm says "extra characters on line". And as i know, fsub without operands equivalent fsub st,st(1).
Post 03 Jul 2012, 15:09
View user's profile Send private message Reply with quote
dmitriy566



Joined: 19 Jun 2012
Posts: 25
Location: Saint-Petersburg, Russia
dmitriy566 03 Jul 2012, 16:16
And as i see, analogical behaviour have opcodes fadd,fmul,fdiv and reverse operations(fsubr and others).
Post 03 Jul 2012, 16:16
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 03 Jul 2012, 16:19
use
Code:
FSUB ST,ST1 instead of: FSUB ST,ST(1)    

_________________
smaller is better
Post 03 Jul 2012, 16:19
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20401
Location: In your JS exploiting you and your system
revolution 04 Jul 2012, 07:48
dmitriy566 wrote:
And as i know, fsub without operands equivalent fsub st,st(1).
Perhaps you are thinking of another assembler that does this? There is nothing stated in the CPU manuals to show this equivalence.
Post 04 Jul 2012, 07:48
View user's profile Send private message Visit poster's website Reply with quote
dmitriy566



Joined: 19 Jun 2012
Posts: 25
Location: Saint-Petersburg, Russia
dmitriy566 06 Jul 2012, 12:19
Thank you very much!
Post 06 Jul 2012, 12:19
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.