please don't get angry because of my dumb questions.....
Ok...how do you do functions in FASM? It seems very different from MASM and TASM.

Whats the equivalent of float in ASM ? How do I use floating point variables?
Posted on 2002-11-05 08:53:53 by CyberGuy
Hi CiberGuy,

by functions you mean procedures?

Then look at this: http://www.asmcommunity.net/board/index.php?topic=8339

and then RTFM ;)
Posted on 2002-11-05 11:00:37 by slop
Thanks.... What in the Fasm Manual? It doesn't have anything with proc in the help file.
Posted on 2002-11-05 17:17:42 by CyberGuy
Cyber,
I mean red the manual for the floats.
I can't check it now, but they are the usual way:



float1 DD 1.23456


Also the 'f' suffix can be used if your version of fasm is 1.40 or later.

And there's also a macro if you need to use floating quads:
struc equq value
{
virtual at 0
dq value
load .low dword from 0
load .high dword from 4
end virtual
}

Now, I think I've done your homework ;)
Posted on 2002-11-07 10:23:10 by slop
thanks, I read the manual now....but is there any other fasm proc example?
Posted on 2002-11-08 17:13:29 by CyberGuy
Cyber,

in assembly language you can turn anything into a procedure, not like high level languages, in which you have to stick to the functions the language gives you or to a library.

The benefit is that you can make very 'tailor-made' programs; the inconvenience is that it takes longer, coz you have to build everything from scratch.
That's why asm programmers that have been long time programming have built their own set of procedures.

You'll find thousands of examples browsing this forum. For a start-up go to the algos section.

slop
Posted on 2002-11-12 10:50:38 by slop
Thanks, just one problem. How are you suppose to create DLLs that work in other languages if you don't specify argument types for the procedures?
Posted on 2002-11-15 17:29:50 by CyberGuy
Cyber,

Once you have the DLL, you can use it no matter what language you write to access it.

slop
Posted on 2002-11-19 09:02:40 by slop
So the return value is going to be what eax is for other languages, right? Like lets say I put mov eax,somevalue, that somevalue will be returned by the DLL right?
Posted on 2002-11-19 15:04:17 by CyberGuy
DLL is just a library of your procedures, which calling convention they are using is your choice. When you declare such procedure in some other language you should specify which convention it is using (usually stdcall, but there are other choices: cdecl, pascal, or register).
Posted on 2002-11-19 15:25:49 by Tomasz Grysztar
Ok, thanks everyone
Posted on 2002-11-20 15:45:08 by CyberGuy