Hello!

I've been throwing together a small tool for converting (particularly SDK) .h files into OA32-aware MASM-format .inc files :) - I'm aiming at SDK headers, but I hope to be able to eventually convert arbitrary C/C++ project sources (not just the headers).

This tool is meant as an update and replacement for the tired old h2inc tools.
Like them, it won't always produce a perfect output, but it will eliminate 99% of the work required to transcribe a header file.

I offer this beta for testing. If you manage to crash it, please post the file which failed to this thread.
And if you see anything really horrible in the output, let me know and I'll handle it :)

Worth mentioning that you can create NEW output files by simply typing the name, and if you "forget" to type the file extension, it will default to ".inc"

As soon as some other people get involved, I'll be able to better describe the limitations of the tool, what it does, and more importantly what it doesn't do for you. I figure that a lot of the complaints people will have are already being addressed ;)


Attachments:
Posted on 2009-12-15 21:12:50 by Homer
up! :lol:
Posted on 2009-12-17 07:39:02 by andy_zzz
Homer,

Could you tell me how to go about creating win32 api include files, something like masm, for gnu assembler in mingw. To start off with, I'm just looking at just constants. Currently the only way to use win32 api using gnu assembler is to search for the value of a constant in the c header files and manually insert that as a constant.

Thank you

Posted on 2009-12-18 05:43:08 by uglyhunK
Why bother with gas? Even if you have to use the GNU toolchain for gcc/ld, you can use an assembler that assembles to coff or elf format, which both nasm and fasm handle.
Posted on 2009-12-18 07:33:09 by f0dder
Homer, I would like to understand how to generate these include files. I have seen masm and fasm include files with macros, which greatly increases the productivity of writing win32 apps in assembly. But for mingw users, unfortunately there are nothing, not that I'm aware of. Like me, I'm sure many are comfortable sticking to gnu tools, for various reasons. So, just thinking about the way to generate these include files for use with gas.
Posted on 2009-12-18 12:04:11 by uglyhunK
Can i recommend:
jwasm  (BIN, COFF, WIN64, MZ, ELF32, ELF64, OMF) + japheth's win32/64 include files + japheth's h2incx,
all that and plenty more at http://www.japheth.de/  :O
Posted on 2009-12-18 14:48:32 by drizz

Homer, I would like to understand how to generate these include files. I have seen masm and fasm include files with macros, which greatly increases the productivity of writing win32 apps in assembly. But for mingw users, unfortunately there are nothing, not that I'm aware of. Like me, I'm sure many are comfortable sticking to gnu tools, for various reasons. So, just thinking about the way to generate these include files for use with gas.


You just read the C/C++ headers and translate the statements to the syntax of your assembler of choice.
With older versions of Visual Studio, Microsoft included a tool itself, called h2inc. That's more or less how the MASM32 headers started. People just started converting headers to include files, either with the help of h2inc, or with manual editing.
Posted on 2009-12-18 16:32:08 by Scali

Homer, I would like to understand how to generate these include files. I have seen masm and fasm include files with macros, which greatly increases the productivity of writing win32 apps in assembly. But for mingw users, unfortunately there are nothing, not that I'm aware of. Like me, I'm sure many are comfortable sticking to gnu tools, for various reasons. So, just thinking about the way to generate these include files for use with gas.
gas wasn't really meant for "assembly development", but as a backend for gcc - this shows in the features it has. As I mentioned before, even if you use the GNU toolchain for other stuff, there's not much reason to use gas... an assembler like NASM is much better, and available on just about any platform you'll need.
Posted on 2009-12-18 18:15:28 by f0dder
Last I heard of JWASM, it had some serious bugs in the ELF implementation, and Japheth didn't seem particularly interested in fixing them.
Believe me, as soon as that issue is resolved, I'll switch to JWASM the very same day, due to its supporting MASM syntax (including known bugs in ML.exe, lol, THATS what I call compatible!)

Anyway, that's completely irrelevant.
I'll continue tinkering with this tiny project whenever I get bored with my larger projects, or just as a change of pace, noting that I am generating ObjAsm32-aware headers, whereas the other tools do not (ie, not just interfaces but class definitions and typed class methods and other stuff)
Posted on 2009-12-18 19:36:45 by Homer