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.
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.
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.
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:
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?
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?
The '%' character is ok. Its assembler source and no bash script :)
It's done. ;)
I didn't know it was added...
The actual solution is convenient and easy to use... :alright:
Thanks.
The actual solution is convenient and easy to use... :alright:
Thanks.
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).
"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).
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 :/
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.
Privalov: great work.. I hope the MASM nonsense stops soon.
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.