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: 27
Location: Saint-Petersburg, Russia
dmitriy566
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: 17247
Location: In your JS exploiting you and your system
revolution
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: 27
Location: Saint-Petersburg, Russia
dmitriy566
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: 27
Location: Saint-Petersburg, Russia
dmitriy566
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: 308
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
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: 17247
Location: In your JS exploiting you and your system
revolution
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: 27
Location: Saint-Petersburg, Russia
dmitriy566
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-2020, Tomasz Grysztar.

Powered by rwasa.