Re: using common macros in NASM and C




Frank Kotler wrote:

I don't know why assembler authors didn't think to make their assemblers
accept "#define"... I think Gas will include .h files(?). But that won't
help you with Nasm...

I was under the impression that GoAsm did this.
Then again, as a result of choosing to mimic the C preprocessor,
GoAsm's macro facilities tend to be much weaker than those found in
other assemblers.


Johannes Kroll has written a "converter" from .h files to something Nasm
will read. Won't read *everything* that you might find in an .h file,
but if you can keep the "common" .h files within its capacities, you can
run it on .h files as part of your build process. That's the closest I
know of to what you'd like to do...

Site where I found it seems to not find it. Latest version I have is here:

http://home.comcast.net/~fbkotler/h2incn-0.5.tar.gz

Thanks, Johannes!!!

Of course, the problem with the ".h"->".inc" translators is that they
only work with a tiny subset of the stuff that normally appears in an
..h file. Of course, if you're specifically writing the .h file for
assembly and C usage, this would work.
Cheers,
Randy Hyde

.



Relevant Pages

  • Re: which book to start with...?
    ... so if i start with Duntemann's book and later have to do some low-level stuff and DosEmu stops me, ... I like Nasm, and I don't think you'd go wrong with it. ... If you're going to "get into" the Linux code, you'll want to know at least a little Gas... ... Might help you compare assemblers to see which you prefer, ...
    (alt.lang.asm)
  • Re: Between Assemblers
    ... The distinction is made on the feature sets of these assemblers. ... > my box are hobby. ... Gas would have been the assembler, ... > that is used on any gcc based OS. ...
    (alt.lang.asm)
  • Re: Why RosAsm Breaks on a large number of symbols
    ... > Then, in some way, RosAsm is more sophisticated ... the fastest of all the assemblers. ... > not robust, and this is enough to make him happy. ... > Could Gas be so nice? ...
    (alt.lang.asm)
  • Re: Will HLA2.0 Support rosasm?
    ... If I'm not using HLa, I'm using GoAsm, FASM, or NASM. ... > YASM and they are all well written working assemblers. ... Gas is questionable. ... > code for either platform because of its capacity to use different ...
    (alt.lang.asm)
  • Re: Between Assemblers
    ... >> MASM, TASM, HLA ... >> NASM, GoAsm, FASM, Gas ... > my box are hobby. ... > assemblers that helped create the OS. ...
    (alt.lang.asm)