question: is fasm's binary layout the same as masm? can it be used to create COM components for instance?
Posted on 2002-07-24 15:52:08 by Hiroshimator
Just look in the EXAMPLES directory in the fasm package. There are two examples of using binary output mode: one of creating .COM program and one of creating .SYS device driver. This kind of output is very flexible, you can use it to create your own format executables, for example MenuetOS executables are made using it, in the Linux package there is also example of creating ELF file using the binary output.
Posted on 2002-07-24 16:57:45 by Tomasz Grysztar
no COM as in Component Object Model

Basically the question is wether fasm generates the same virtual table layout. :|
Could that be supported?

Posted on 2002-07-24 17:06:48 by Hiroshimator
Well, how does it look?
Posted on 2002-07-24 17:10:12 by Tomasz Grysztar
I thought it was

--> --> methods

something like this :|
Posted on 2002-07-24 17:33:44 by Hiroshimator
Well, you want to have such structures in binary file or in the PE excutable?
I think fasm should be able to create them in both cases, but I still need more information about what you need.
Posted on 2002-07-24 17:58:39 by Tomasz Grysztar
I'll try to get more info about the exact format :)

Thx for your patience


Posted on 2002-07-24 18:03:47 by Hiroshimator
There's nothing specific to the executable layout with COM. Just declare the structures for the com interfaces and a pointer. You might want to write a macro like coinvoke for fasm.
Posted on 2002-07-25 07:00:53 by grv575
Yes Hiroshimator, COM can be done.
Tomasz, this is the required info:

In the PE COFF format, three new flags need to be defined for the sections:

The section contents is communal data (comdat). Communal data is data (or code) that can be defined in multiple OBJs. The linker will select one copy to include in the executable. Comdats are vital for support of C++ template functions and function-level linking. Comdat sections only appear in OBJ files.
This is the most important, to maintain inheritance and all those features of objects. It should be something like this:
section '.code' code readable executable comdat
The others are:

The section contains information for use by the linker. Only exists in OBJs.

The section contents will not become part of the image. This only appears in OBJ files.
So this way we are letting the linker do the COM stuff with other c++ modeles for us.

Maybe it would also be needed to define a special meaning for '$' in the name of sections. This tells the linker the order to merge sections and other nifty features. But that's advanced stuff anyway.
Posted on 2002-09-30 03:41:24 by slop