Hey guys. As always, I have a question. Maybe someday after I ask enough of them I will actually contribute to someone elses for a change ;) How can I write modular asm programs? Really I just want to know how to have more than one source file. Also, is there any speed or memory disadvantge to putting proceedures into structs to make something similar to a c++ class? Could I put a macro instead of a proc? Which is faster if both are ok to do? I actually don't even know if proceedures and macros can go into structs, but if they can't I'm sure I'll find out when I try to do it, heh. Thanks.
Posted on 2001-10-02 02:56:12 by AlexEiffel
Alex,

There are plenty of way you can write modular programs, each procedure is technically modular, you can write seperate files and either build them into libraries or linmk them into the main program.

MASM handles the INCLUDE capacity well and it lets you include a complete file directly in your code.

It may be worth you having a look at both Ernie Murphy's COM work and the work that Mirno and Thomas are doing in OOP style masm coding as it will show you an alternative architecture that is closer to the VC approach.

Macros are very useful and flexible as well, they can range from simple macros that just do text replacement to fully blown loop and conditional code.

Regards,

hutch@pbq.com.au
Posted on 2001-10-02 06:02:22 by hutch--
Err... ah...


Thats "NaN and Thomas", or Thomas and Nan... eheheh :grin:

:) ( You can tell Hutch isnt an OOP fan ) :)

Anyways, you can find A Beta of our OOP model in the COM section. Look for all the treads concerining Objects.inc or OOP. Thomas and myself have tried to get a fair bit of examples out in the short time that we have. But no concrete tutorial has been written as of yet.

The model places function pointers into structures, and thus, we start calling them classes. If you tear thru any of the examples you can see ONE sytle of keeping files modular. There is others.

Oh ya, the model is also automated with MACRO's, to keep the coding simple and less confusing to properly set up MASM requirements for function pointing. All the macro's are found in Objects.inc, and are well documented.

As for putting MACRO's in structs, i couldnt say. On the surface, I could say, it might be possible. As structs are only a compiler level concept, and so is macro's. Neither actually turn into code themselves, but both affect how code is compiled. I wouldnt know why you would want to do this tho...??

Anywho.. Check them out.. see what you think.. and please feel free to ask questions.

NaN
Posted on 2001-10-02 07:40:44 by NaN
Nan,

Sorry about that, its the senile decay showing again. :)

Regards,

hutch@pbq.com.au
Posted on 2001-10-02 09:16:14 by hutch--
Its all good...

You actually had me on my Toes for a brief moment to see if Mirno had been up to something i havent caught wind of... But since he has no web page, i eventually concluded it was just a mental fart :)

NaN
Posted on 2001-10-02 22:17:39 by NaN