flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Why can't i [ push 5.0 ] if i can [ dd 5.0 ]

Author
Thread Post new topic Reply to topic
ravenX



Joined: 01 Oct 2005
Posts: 7
ravenX
If i just want to load 5.0 in st (or xmmn for example)
[
push 5.0
fld [esp]
]
seems clear but doesn't work
It was said (in topic about float calculations at compile time) that FASM treats floats as dwords so why can't i push it?
Post 04 Oct 2005, 19:29
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7795
Location: Kraków, Poland
Tomasz Grysztar
fasm doesn't just treat floats as double words, it chooses the right conversion depending on context - compare "dd 5.0" with "dq 5.0" and "dt 5.0".

You must have been using "push 5.0" in 16-bit mode, since in 32-bit it works. In 16-bit mode the default size for push is 16-bit and there is no 16-bit floating point format - thus the error. Try "pushd 5.0" or "push dword 5.0".
Post 04 Oct 2005, 20:18
View user's profile Send private message Visit poster's website Reply with quote
ravenX



Joined: 01 Oct 2005
Posts: 7
ravenX
I've now got it. I'm writing Win32 program and include one ASM file into another. I usually try to compile this standalone file for syntax checking. I've quite forgotten about default use16 mode. The main program compiles right.

Sorry for wasting your time...
Post 04 Oct 2005, 20:46
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.