News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Splitting source file

Started by Neil, June 20, 2008, 08:35:27 AM

Previous topic - Next topic

Neil

How do I split my growing source file into smaller modules?

I've tried making a library file & using include but can't get it to work

Tedd

What I usually do is simply split the source into multiple files, and then "include" the extra files in the 'main' source file.

So, in the main source file (the one you assemble), just before the main code, you have:

include stuff.asm
include more.asm
include things.asm

..and then your main code follows (or indeed, you could place that in a separate file and your main file is just a list of includes.)
No snowflake in an avalanche feels responsible.

Neil

Thanks Tedd,

That works O.K. :U

I was trying to do it from inside qeditor, should have tried the simple way first

PBrennick

One thying to remember when you are creating a library (.lib) is that all callable procedures really should be in their own file so that the linker will see them correctly. This prevents granularity.

If you do this, you do not need to use includes at all, you would create aseries of .obj files and then let the linker combine them. You would create a .inc file containing the prtotypes of each procedure. This method is readily examinable in either masm32 or GeneSys by looking in the library source folder. Look at the batch file to see how it is done.

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

Neil