flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [request] command line include

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
RedGhost, you MUST use match instead. Check my previous post to see why.
Post 21 Apr 2006, 13:22
View user's profile Send private message Reply with quote
turdus



Joined: 19 Apr 2006
Posts: 8
turdus
RedGhost wrote:

...
nasm is crap compared to fasm, it's a design principle of the assembler and frankly i love it, that's one of the things that really bothered me about nasm was all the command line stuff, i see no reason why preprocessor isn't good enough for you here Surprised

here i provide another solution even

Because the point is not including different files, the point is always parsing a specific file before the main file.
Short story: I designed a macro language with nasm. I used it just like
Code:
clcomp something.cl
    

where "clcomp" was an alias:
Code:
nasm -P /usr/include/CL.inc
    

It went well, and I made a lot of code.
Unfortunatelly nasm lacks some feature I needed, which fasm has, but fasm lacks command line input, so I can't use neither of them. Here we are. I made a request for command line include, I got many stupid answers for a stupid example and reasons why not. Thanks, but that won't help me out, and I don't want to mess up my CL files with includes at begining. End of story.

Besides, all common compiler has command line input, wonder why...

ps1.: you don't have to use command line include if you don't want to.
ps2.: I started this thread beacuse I thought there are others missing this feature.
ps3.: I patched my version
Post 21 Apr 2006, 13:22
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
can't help you, i just want to react on this:

Quote:
Besides, all common compiler has command line input, wonder why...
Most languages are overbloated and badly designed. FASM is unlike these, it's minimalistic and most clear language in it's category. Wonder why... maybe it has something to do with not including every feature someone would use once a especially when problem can be solved other way.

Didn't source in your language have any header? Is it that pain to have one more line there. In your case external input even is not needed, there are problems which require external input much more than saving one line per source.
Post 21 Apr 2006, 14:08
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost
locodelassembly wrote:
RedGhost, you MUST use match instead. Check my previous post to see why.


before posting i tested win32.inc had xor eax, eax and linux.inc had 'mov dax, 4' <-- error, when WIN32 = 1 xor eax, eax was compiled and when LINUX = 1 an error was given and if neither were defined it would print the display message assemble nothing and give no error

how exactly could the wrong macro be used if only one file is included and parsed? Confused

_________________
redghost.ca
Post 21 Apr 2006, 17:44
View user's profile Send private message AIM Address MSN Messenger Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost
turdus wrote:
I made a request for command line include, I got many stupid answers for a stupid example and reasons why not


i find it hard to believe that the many people who replied, all of whom were against commandline includes are stupid and you are infact the only intelligent one, infact i assume it may be quite the opposite but there is no reason for flamming or an argument Surprised

edit: gah my first double post nooooo Embarassed

_________________
redghost.ca
Post 21 Apr 2006, 17:55
View user's profile Send private message AIM Address MSN Messenger Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Just because you prefer FASM doesn't mean you should ignore NASM -P (or whatever) if it does what you want. If you need certain "features" of FASM and/or NASM, then you are heading towards HLL and not pure assembly anyways. If you look at FASM's source, it does not use every advanced feature there is. I personally avoid lots of the high level stuff, but that's out of unfamiliarity and distaste for such things (and also so my wimpy code is easier to port to other assemblers, if needed).

FASM was written with different goals in mind than NASM, so if you want FASM to do something, you're best off modifying it yourself. Privalov has better things to do than to cater to every feature request. Believe me, I've had the urge to request a few things myself, but I have restrained myself so as not to be lame. Maybe some people should fork FASM (like XEmacs, YASM, Kolibri, etc).

For instance, I don't like the way FASM is able to overwrite the input file with the output, but this can be avoided (if necessary) by a simple .BAT file. See? No reason to nag Privalov or to modify FASM itself when an outside tool can do the job.

Sometimes, if you want something done right, you've got to do it yourself. Besides, doing stuff by yourself is the best way to learn. Smile

Code:
@echo off
REM fasm.bat

if "%1"=="%2" goto next
fasm.exe %1 %2
goto end

:next
fasm.exe %1

:end
    


P.S. I like Tomasz's batch hack above, it's cool. I do stuff like that all the time. Very Happy

P.P.S. Post number 100, woot! Razz
Post 21 Apr 2006, 19:46
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
RedGhost wrote:
how exactly could the wrong macro be used if only one file is included and parsed? Confused


If you use "if" instead of "match" both files gets included and parsed and one of them gets assembled. I'm think that the better way is using match as UCM does (2nd post in this thread), is faster and prevents undesirable interactions between both include files.
Post 21 Apr 2006, 23:21
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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-2020, Tomasz Grysztar.

Powered by rwasa.