NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: jsvcycling on July 05, 2011, 03:00:54 AM
-
I'd like to know if it is possible to include C headers in NASM source files. I know you can use EXTERN to reference C functions, but is it possible to include C headers (similar to GAS)?
If not, I'd like to recommend that as a feature for future releases...
Thanks,
Jsvcycling
-
Rob Neff is working on something that will convert a C header into an .inc file suitable for Nasm:
http://h2incn.svn.sourceforge.net/viewvc/h2incn/trunk/
I don't anticipate the ability to eat .h files to be incorporated into Nasm, but it's an interesting idea...
Best,
Frank
-
I don't anticipate the ability to eat .h files to be incorporated into Nasm, but it's an interesting idea...
I guess we might pick it up into contrib/ directory or something like that.
-
I guess we might pick it up into contrib/ directory or something like that.
Sounds like a good idea if it won't be implemented anytime soon, I can't help you very much because I'm still a NASM N00B...
http://h2incn.svn.sourceforge.net/viewvc/h2incn/trunk/
Thanks, I'll check it out...
Thanks,
Jsvcycling
-
C preprocessor parser is not hard thing (nasm preprocessor is a way more powerful) so I suspect we might consider implementing some converter inside nasm code directly as only time permits ;)
-
my version of h2incn on sf.net remains incomplete. I will revisit that project once NASMX v1.0 is out of beta ( Real Soon NowTM).
Cyril, I'm not sure if adding that capability to Nasm would be worth your effort, especially in light of what most Windows Nasm users would want it to do - pull in the entire Windows headers fileset - needed due to the many dependencies among the various files. However, don't let me stop you if you feel it worthwhile! ;D
-
my version of h2incn on sf.net remains incomplete. I will revisit that project once NASMX v1.0 is out of beta ( Real Soon NowTM).
Cyril, I'm not sure if adding that capability to Nasm would be worth your effort, especially in light of what most Windows Nasm users would want it to do - pull in the entire Windows headers fileset - needed due to the many dependencies among the various files. However, don't let me stop you if you feel it worthwhile! ;D
OK, I see ;) I meant not only Windows users but imagine an abstract user who mixing C and asm code, in most cases there will be shared #define/%define :)
-
In addition to #define are you also thinking about supporting typedef and struct { }; ???
And since we're talking about enhancing Nasm - can you please add support of nested structs/unions.
My original forum post (http://forum.nasm.us/index.php?topic=872.0) asking for that feature.
You would make a lot of people happy! ;)
-
oh, Rob, I still didn't manage with a way more trivial things in nasm, no time :( But I would like you to pull into development team :) Mind to try to enhance nasm? :D
-
I mean I don't lose the hope to pull you into dev team ;)
-
If I can find some free time this month or next I just might be motivated enough to take a shot at it ;)