flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > usage: fasm source [output]

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 09 Jul 2004, 21:47
Code:
flat assembler  version 1.53usage: fasm source [output]    


Privalov,
This is a long desired option, that maybe you will find useful, Fasm could guess the output filename from the format directive, so it could be an optional command line parameter. Like in fasmw with dlls and exes.

I need mainly when coding on linux.

What do you think Cool
Post 09 Jul 2004, 21:47
View user's profile Send private message Yahoo Messenger Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 10 Jul 2004, 08:20
I agree... That would be a nice feature.
Post 10 Jul 2004, 08:20
View user's profile Send private message Visit poster's website Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 10 Jul 2004, 18:45
I'd say that if no output is specified then output = input - extension (thus all text before but not includng the last dot )

eg.
fasm input.asm => "intput"
fasm input.something.foo.txt.asm => "input.something.foo.txt"

Guessing output names beyond this could be hazardous...

(/me still dreams of fasm output to stdout (of the compiled data only, no "extra" output)) Wink
Post 10 Jul 2004, 18:45
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 10 Jul 2004, 21:36
Actually I am doing that way, stripping the ".asm" when launched by file association.

Fasmw guesses the extension from format directive and I see no hazard on it. There are no ambiguities. Am I missing something?

Imagine if you "dblclick" an asm file in any filemanager and Fasm produces exactly the file you intended. Smile
Post 10 Jul 2004, 21:36
View user's profile Send private message Yahoo Messenger Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 11 Jul 2004, 16:38
how does it know if I want no extension, .bin, .foo, .bar, or .whatnot? You see that kind of "hazard"
Post 11 Jul 2004, 16:38
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 11 Jul 2004, 16:44
then you could use "fasm source output" form. The whole simplification wouldn't have any sense if I had to modify filename by myself.
Post 11 Jul 2004, 16:44
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 11 Jul 2004, 16:46
Look that it is optional, it guesses only if you don't specify output.

What about this:
Code:
format            extension
(none)            . (or .com or .bin)?
elf executable    .
elf               .o
MZ                .exe
PE                .exe
PE DLL            .dll
COFF              .obj
MS COFF           .obj
    
Post 11 Jul 2004, 16:46
View user's profile Send private message Yahoo Messenger Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 11 Jul 2004, 20:37
BTW, why ordinary COFF files have default .obj extension? GCC produces *.o Confused
Post 11 Jul 2004, 20:37
View user's profile Send private message Visit poster's website Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 12 Jul 2004, 16:00
my suggestion:
Code:
format     | suffix
-- ---------+-------------------------------------------------------------------
(none)     | (none - it's just a flat file, plain and simple)
elf (exec) | (none)
elf (obj)  | .o
MZ         | .exe
PE         | .exe
PE DLL     | .dll
COFF       | .o/.obj (maybe OS related, .o for *nix/*bsd/etc, .obj for Win/DOS)
MS COFF    | .obj    
Post 12 Jul 2004, 16:00
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 12 Jul 2004, 16:04
Perfect !
Now left only the boss' opinion Smile
Post 12 Jul 2004, 16:04
View user's profile Send private message Yahoo Messenger Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 12 Jul 2004, 16:44
maybe .com extension when selecting "format binary", which is the default option, but specifing it is still valid?
Post 12 Jul 2004, 16:44
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 13 Jul 2004, 08:20
Quote:
This is a long desired option

In fact I don't recall any serious requests for this feature - though it's quite easy to add.

As for the "extensioning" strategy - isn't the one used by fasmw enough? I'd copy it when implementing into console versions.
Post 13 Jul 2004, 08:20
View user's profile Send private message Visit poster's website Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 13 Jul 2004, 17:44
decard wrote:
maybe .com extension when selecting "format binary", which is the default option, but specifing it is still valid?

IMO binary means (flat) binary, not .com (which iirc, actaully has an orgian at 100h, not 0h (as "pure flat binaries")). better go with some "format com" instead.

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 13 Jul 2004, 17:44
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 13 Jul 2004, 19:18
isn't it possible to get "origin" of first data in file when quesing extansion? If yes, then COM file will be generated only if first data of flat binary is at origin 100. I think such quessing would be okay and backward compatible too.
Post 13 Jul 2004, 19:18
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 15 Jul 2004, 13:37
It's a good idea, though it cannot be done this way. But it might be possible to catch the values given to "org" directive and store the first one (or the last one used at the point, where not yet any data has been generated) for later extension guessing.
Post 15 Jul 2004, 13:37
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 15 Jul 2004, 18:38
i think it should catch argument of first "org" not preceded by data and followed by data immediately (eg. no other "org" between them).
Post 15 Jul 2004, 18:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 16 Jul 2004, 04:14
I second scientica on "format com".
Reasons:
1. Conceptually, com is a format (one that is not different to plain binary, but a format anyway)
2. Extension guessing depending on directives other than format could become very complicated or ambiguous.
Post 16 Jul 2004, 04:14
View user's profile Send private message Yahoo Messenger Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 16 Jul 2004, 15:56
format com is a nice idea, but would be unusual

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 16 Jul 2004, 15:56
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 17 Jul 2004, 05:49
My suggestion is to add another one directive to header
Let it look like this one (for Windows):

Code:
format PE GUI 4.0 with '.bin'    


Of course it would be an optional parameter
Post 17 Jul 2004, 05:49
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 17 Jul 2004, 09:35
i agree more with mike than with others, but remember we are talking about *QUESSING* filename extension, so it can be (or should) be heuristical. Don't you think it will be confusing to see some .COM files with "format COM" and some without? Also, would you like to add another format for every case when someone might want another extension, like "MZSYS" or "PECPL"? Also it won't be precise - that wouldn't be another formats, format will be still binary regrdless if it's data file or .COM file, that would be hint to quess desired extension, and so it would be confusing what "format" is what real format etc.

Mike's idea is better, but i think having another keyword to QUESS filename extension (which should be extreme case, when you CAN'T specify it in command line) doesn't look so good to me.

If some heuristic scanning of source code will be possible, then i think it will be best solution.
Post 17 Jul 2004, 09:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.