Does FASM uses environmental variables ?
I.E MASM (ml) uses a facultative INCLUDE environmental variables to know where the includes files are stored...
I find it is a good solution as you don't have to manually copy include directory in your project directory, or write the include as a hard-coded full path... which can break if you move the directory from one drive to another...

If no, can it be added?

Thanks.
Posted on 2002-08-12 00:55:15 by JCP
Don't know about environment variables, but I always use include '\fasm\include\blah.blah' which means the the fasm directory is in the root directory of a drive and the source code is somewhere on the same drive.
Posted on 2002-08-12 06:55:24 by Eóin
I've decided to use solution proposed by Maverick some time ago (download the latest beta to have implementation of it): the names enclosed within % characters in path are replaced with the values of appropriate environment variables. For example, when you have INCLUDE=c:\fasm\include variable defined, you can include files the following way:


include '%include%\kernel.inc'

It's already done for DOS and Win32, I don't know how to make it for Linux, should the enclosing % characters be used there also, or should I allow there $name form, like it is in Linux shells (in opposite to command.com)? I'd prefer %name% because it's easier to implement and there would be the one standard for all fasm versions, but when you provide paths with Linux version you already have to use slashes instead of backslashes, so maybe it would be better to follow the system's convention. What do you think?
Posted on 2002-08-12 08:02:06 by Tomasz Grysztar
The '%' character is ok. Its assembler source and no bash script :)
Posted on 2002-08-12 08:05:05 by bazik
It's done. ;)
Posted on 2002-08-12 09:21:25 by Tomasz Grysztar
I didn't know it was added...
The actual solution is convenient and easy to use... :alright:

Thanks.
Posted on 2002-08-12 09:41:32 by JCP
I forgot to replace some files with new versions when I previously uploaded the beta 6, so please download it once again if you downloaded it earlier (before this post). Environment variables are replaced everwhere in paths used by fasm, so it will work also with file and load directives, and in command line too. For example
"fasm foo.asm %systemroot%\foo.exe" will create the executable in Windows directory (this is how it always worked in .BAT files, but now it works in all cases).
Posted on 2002-08-12 11:13:18 by Tomasz Grysztar
Privalov, you could support both slashes and backslashes for both linux and other systems, and convert to whatever the host OS requires... I used to do this back in my 32bit dos programming days. I'm still annoyed microsoft decided to break the standard and use backslashes instead of regular slashes :/
Posted on 2002-08-12 11:49:18 by f0dder
I second f0dder's proposal, and have been doing it too since I migrated to the PC.

Privalov: great work.. I hope the MASM nonsense stops soon.
Posted on 2002-08-12 13:15:19 by Maverick
The Win32 does it automatically, so I added it to the DOS and Linux version. Yes, that was a good idea - now I have full platform-independency. Current beta updated one more time.
Posted on 2002-08-12 14:43:02 by Tomasz Grysztar