flat assembler
Message board for the users of flat assembler.

Index > IDE Development > FASMW's automatic INCLUDE

Author
Thread Post new topic Reply to topic
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 18 May 2020, 16:34
BTW, wouldn’t it be a good idea to provide some means of using FASMW.exe path as base path for INCLUDE directory if none is specified (for FASMW use case, of course). Or am I missing some way to make FASMW work from removable media with different drive letters assigned?

What FASMW does now is to save automatically calculated path into FASMW.ini which doesn’t work well if drive letter changes when the removable media is attached to another machine.
Post 18 May 2020, 16:34
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8363
Location: Kraków, Poland
Tomasz Grysztar 18 May 2020, 16:47
DimonSoft wrote:
BTW, wouldn’t it be a good idea to provide some means of using FASMW.exe path as base path for INCLUDE directory if none is specified (for FASMW use case, of course). Or am I missing some way to make FASMW work from removable media with different drive letters assigned?
FASMW does it automatically when it is first started, that is when there is no FASMW.INI file. When the settings are already present, it does not touch them. But now, with the path added to compiler options dialog, you can easily adjust it on the fly.
Post 18 May 2020, 16:47
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 18 May 2020, 16:57
Not really. Take an external USB-connected hard drive. Write FASM folder there and run it from there. Then unplug it and plug into another computer where it gets another drive letter. It will not use the new drive letter.

Adding the path to compiler options dialog doesn’t add much: since I prefer using default settings I was previously able to just delete FASMW.ini and let the IDE recreate it. Options dialog is just another (somewhat more sophisticated) way to make the adjustment. Still not the real portability.
Post 18 May 2020, 16:57
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8363
Location: Kraków, Poland
Tomasz Grysztar 18 May 2020, 17:02
DimonSoft wrote:
Not really. Take an external USB-connected hard drive. Write FASM folder there and run it from there. Then unplug it and plug into another computer where it gets another drive letter. It will not use the new drive letter.
The FASMW.INI has been created the first time you run it. When the file already exists, FASMW no longer modifies any of the settings by itself. So in your test you'd have to delete FASMW.INI before running it for the second time.

If you'd need to preserve some other settings and still generate this one automatically, I guess that the best option would be to make a batch file for this purpose.
Post 18 May 2020, 17:02
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8363
Location: Kraków, Poland
Tomasz Grysztar 18 May 2020, 17:17
A fun trick (even though with caveats) would be to make your setting on a portable drive be like:

[Environment]
Include=d:\fasm\include;e:\fasm\include;f:\fasm\include;g:\fasm\include;h:\fasm\include
Post 18 May 2020, 17:17
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 18 May 2020, 17:18
Yes, I know the rules and how it works. I just wonder why not add some means to make FASMW use automatically calculated path.

I guess, most people do not change the placement of INCLUDE directory relative to FASMW.exe file. Allowing some value of INCLUDE parameter to indicate FASMW has to GetModuleFileName(0), extract its path and append 'INCLUDE\' piece wouldn’t break anything but could make creating portable FASMW “installation” much easier, without the need for BAT files and stuff.

After all, FASMW already does almost exactly this when run for the first time (with no FASMW.ini), so the code is mostly already there.

P.S. As you might guess, the trick with adding 26 possible letters is cool but… OK, if you suggest making strange things, I’ll ask for the possibility to use the same drive attached to a remote computer (i.e. through network shares) Smile
Post 18 May 2020, 17:18
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8363
Location: Kraków, Poland
Tomasz Grysztar 18 May 2020, 17:24
DimonSoft wrote:
I guess, most people do not change the placement of INCLUDE directory relative to FASMW.exe file. Allowing some value of INCLUDE parameter to indicate FASMW has to GetModuleFileName(0), extract its path and append 'INCLUDE\' piece wouldn’t break anything but could make creating portable FASMW “installation” much easier, without the need for BAT files and stuff.

After all, FASMW already does almost exactly this when run for the first time (with no FASMW.ini), so the code is mostly already there.
This would need INCLUDE to get special treatment in the interface between OS and fasm core and I don't think that would be worth the effort. Note that the settings in [Environment] are just an added layer on top of the actual OS environment, and fasm's core uses the environment access in the same way no matter which interface and on what OS it is (whether command line or GUI).
Post 18 May 2020, 17:24
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 18 May 2020, 17:43
But what does it have to do with fasm core? I just suggest adding some special value of INCLUDE parameter or other means to make FASMW do its auto-path-generation trick every time it starts, no matter if FASMW.ini exists or not.
Post 18 May 2020, 17:43
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8363
Location: Kraków, Poland
Tomasz Grysztar 18 May 2020, 18:56
DimonSoft wrote:
But what does it have to do with fasm core? I just suggest adding some special value of INCLUDE parameter or other means to make FASMW do its auto-path-generation trick every time it starts, no matter if FASMW.ini exists or not.
It is core that does the interpretation of the value of INCLUDE, the fasmw's interface does no such thing, it just passes the value through. So to make fasmw aware of a special value, it would need to have some additional interpreting layer added, and because fasmw normally does not need to access INCLUDE by itself (only core does), the most straightforward would be to put that interpreting code into the function that reads the value of environment variable for the core.

And yes, of course there is also a route of adding a completely separate option just for fasmw to make it generate INCLUDE on each start, but then there would be an option in another place in .INI file that would invalidate the option in [Environment] section and that feels like something potentially confusing. Personally I would definitely delegate things like that to some external batch/shell script processing.
Post 18 May 2020, 18:56
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 816
Location: Russian Federation, Sochi
ProMiNick 18 May 2020, 20:00
revolution!!!!!!!!!
Until what time I will have to make fixies in patchs instead of thou?
for fasmw 1.73.24 (fedit 0.99.08) compatibility:
Code:
;seven patches for the IDE caption

        if defined _caption

                patch convert_table,            <push _caption>,<call ARM_push_caption>,256
                patch loading_error,            <push _caption>,<call ARM_push_caption>,26 ; patch quoted_argument_end,      <push _caption>,<call ARM_push_caption>,91
                patch not_enough_mem,           <push _caption>,<call ARM_push_caption>,23
                patch move_file_name,           <push _caption>,<call ARM_push_caption>,76
                patch open_single_file,         <push _caption>,<call ARM_push_caption>,52
                patch run_object,               <push _caption>,<call ARM_push_caption>,2
                patch drop_files,               <push _caption>,<call ARM_push_caption>,102

                ARM_push_caption:
                        mov     eax,_logo
                        xchg    eax,[esp]
                        jmp     eax

        end if    

I comment that was now is wrong and replace it by correct patch.

Tomasz in last modernization bug that was never before:

my fasmw.ini content:
Code:
[Environment]
Include=\..\..\FASMPACK\INCLUDES;\..\..\FASMPACK\RES\BINARY;\..\..\FASMPACK\RES\TEXTUAL    


what I see in Compiler Setup Dialog:
Quote:
Include path:
\..\..\FASMPACK\INCLUDES;\..\..\FASMPACK\RES\BI

I assume include is 255 bytes ASCII?
Thanks in advance.


Last edited by ProMiNick on 18 May 2020, 20:13; edited 1 time in total
Post 18 May 2020, 20:00
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8363
Location: Kraków, Poland
Tomasz Grysztar 18 May 2020, 20:12
ProMiNick wrote:
Tomasz in last modernization bug that was never before:

my fasmw.ini content:
Code:
[Environment]
Include=\..\..\FASMPACK\INCLUDES;\..\..\FASMPACK\RES\BINARY;\..\..\FASMPACK\RES\TEXTUAL    


what I see in Compiler Setup Dialog:
Quote:
Include path:
\..\..\FASMPACK\INCLUDES;\..\..\FASMPACK\RES\BI

I assume include is 255 bytes ASCII?
Oh, I forgot ES_AUTOHSCROLL style for the edit box!
Post 18 May 2020, 20:12
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 816
Location: Russian Federation, Sochi
ProMiNick 18 May 2020, 20:24
Tomasz, thanks.

revolution, may be if fasmarm sources unaccessible for edition by security reasons - Thou could migrate ARM32 (atleast ARM mode) to fasmg implementation.

No one of assembler tricks that switching modes, or representing some of if-blocks as instructions dosn`t required - such things I expect compiler will left to programmer. (that only one thing that I hate in fasmarm, it reverts behavior of if and/or macro that way that in some cases they act differently from fasm1, and some time errorneusly( ) (thour macros teached to give up after some number of tryes - and in that case compilation is successful, but output is wrong)
Post 18 May 2020, 20:24
View user's profile Send private message Send e-mail Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 18 May 2020, 21:51
Tomasz Grysztar wrote:
DimonSoft wrote:
But what does it have to do with fasm core? I just suggest adding some special value of INCLUDE parameter or other means to make FASMW do its auto-path-generation trick every time it starts, no matter if FASMW.ini exists or not.
It is core that does the interpretation of the value of INCLUDE, the fasmw's interface does no such thing, it just passes the value through. So to make fasmw aware of a special value, it would need to have some additional interpreting layer added, and because fasmw normally does not need to access INCLUDE by itself (only core does), the most straightforward would be to put that interpreting code into the function that reads the value of environment variable for the core.

And yes, of course there is also a route of adding a completely separate option just for fasmw to make it generate INCLUDE on each start, but then there would be an option in another place in .INI file that would invalidate the option in [Environment] section and that feels like something potentially confusing. Personally I would definitely delegate things like that to some external batch/shell script processing.

Now I see the problem, thanks. I expected it to run fasm.exe as a separate process and use lpEnvironment parameter of CreateProcess (which would make the interpretation implementable in a few LoC) but now, after reading your reply and diving into the source code, it seems like the feature is definitely not a one-liner.
Post 18 May 2020, 21:51
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.