It is currently Sat Jul 21, 2018 6:22 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: compiler /REASM and /COMMENTED enhancements
PostPosted: Wed Dec 20, 2017 11:42 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Nov 26, 2015 6:52 pm
Posts: 148
Location: Italy
PureBasic 5.61

Currently, the pbcompiler behaviour for the /REASM option is a bit puzzling.

It seems that the /REASM option requires a source filename, but at the same time ignores it because it only takes "PureBasic.asm" as source file.

What make it even more puzzling, is that it first checks if the filename passed actually exists, and then looks for the "PureBasic.asm" as source file; if either of them is missing it will raise an error.

But if you invoke the compiler with /REASM without passing a filename it will raise a "source file not found" error, even if the "PureBasic.asm" file exists.

Effectively, with /REASM option, the filename parameter is just a dummy placeholder (except that it must refer to an existing source file). Currently, passing the filename of another source file is perfectly OK, except that the actual file being reasmed is another one (ie: "PureBasic.asm"). This might confuse the user to believe that he actually suceeded into compiling the passed asm filename, which is not the case.

I suggest that

1) the /REASM option should dispense the need to pass a source filename, and default to "PureBasic.asm" when no filename is passed:

Quote:
pbcompiler.exe /REASM


... should implicitly look for "PureBasic.asm", and produce "PureBasic.exe"

2) If a "*.asm" source filename is passed, it should reasm that source file instead of "PureBasic.asm".
This would simplify working with multiple assembly sources in the same folder, without having to rename them back and forth to "PureBasic.asm"

Currently, the compiler checks that the passed filename exists, but then the /REASM option ignores it in favour of "PureBasic.asm" (which must exist).

3) If a "*.pb" source filename is passed, it should reasm the "PureBasic.asm" (and not look for a corresponding "<filename>.asm") — this would preserve backward compatiblity with automation scripts.

4) Also, it would be nice to improve the /COMMENTED option, allowing to specify a custom filename for the output asm file.
Again, preserving the current defaults to prevent breaking backward compatibility.

5) Currently there is no way to produce the asm file (via /COMMENTED) without also producing an exe file. If the /CHECK option is passed together with /COMMENTED,
no asm file is produced. The only workaround I've managed so far is to redirect the executable to some temporay folder, via /EXE.

These changes shouldn't break backward compatibility, and would make life easier when working with multiple asm source files in a same folder, especially
when resorting to scripted automation, or custom IDE tools. The current restriction imposed by the "PureBasic.asm" default forces multiple file rename operations.

For example, a user might wish to convert to asm the same pb source file, for both x86 and x86_64, so allowing the pbcompiler to handle custom filenames for /COMMENTED and /REASM would simplify working with some custom naming conventions like "<filename>_x32.asm" and "<filename>_x64.asm", or even "<filename>_x32_pb561.asm", and so on.

_________________
The PureBASIC Archives:
FOSS Resources:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye