flat assembler
Message board for the users of flat assembler.

Index > Main > BUG?: FPU instruction

Author
Thread Post new topic Reply to topic
kidscracker



Joined: 29 Oct 2004
Posts: 46
Location: Peru
kidscracker
I've been translating code in MASM to FASM and I've realised that in MASM intructions like:
Code:
fadd
..etc.    

are coded correctly in MASM but in FASM it's not allowed that sintaxis, insteand of it I had to write:
Code:
faddp st0,st1   ; faddp insteand of fadd!!!
...etc.
    

the confusing thing is that the instruction isn't fadd, it's faddp!
the question is, Is it an error or sintaxis convention?
Post 19 Dec 2005, 20:52
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
Use "faddp" without any parameters instead - this convention taken from Intel's manuals.
Post 19 Dec 2005, 21:50
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
Try this macro to support the plain fadd
Code:
irp op,add,sub,mul,div {
        macro f#op [args] \{
                \common
                if ~ args eq
                        f#op args
                else
                        f#op#p st0,st1
                end if
        \}
}    
Post 20 Dec 2005, 01:57
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Offtopic:
I just came to a realization why FASM is good in these cases. When other assemblers include a lot of features in the main assembler - FASM leaves those rare cases and one-time-wishes to macros that everyone can choose to include or disclude. FASM itself remains interoperable over all systems. Small and efficient.
Post 20 Dec 2005, 08:35
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
kidscracker



Joined: 29 Oct 2004
Posts: 46
Location: Peru
kidscracker
Thanks!it worked!!!
Post 22 Dec 2005, 01:17
View user's profile Send private message MSN Messenger ICQ Number 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.