I'm trying to beautify my code by making files like:

proto.inc --- for function prototypes working good:alright:

struct.inc --- for structure definitions working good:alright:

But I'm having a problem getting my globals.inc to work(should it work at all?)

I am including after the .data directive in each file:

.data

include globals.inc

But I keep getting an error a0008. I'm trying to find a way to define data outside of the code file and resolve externals through these files.
Posted on 2001-09-21 19:11:39 by ThoughtCriminal
include globals.inc before the data section in your main file
from what i can see your doing it backwards

then in the include file

.data

blah
blah

If your include is a const.inc then it shoud begin like this

.const

there is no need to have .data in all of them


In other words do the includes at the beginning of your file

Here is an example of mine

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
include \masm32\include\winmm.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\winmm.lib

include d:\masm32\mystuff\gamedata.asm
include d:\masm32\mystuff\gamedatani.asm ;< not initialized
include d:\masm32\mystuff\gameconst.asm
include d:\masm32\mystuff\gamemacros.asm
include d:\masm32\mystuff\gamethread.asm
include d:\masm32\mystuff\gamestruct.asm
include d:\masm32\mystuff\global.inc

look above
< this is where your globals.inc should go

and get rid of the "include global.inc in all your includes

then in the main asm the next statement is:

.code


so my gamedata.asm or in your case .inc file should begin with this

.data
Posted on 2001-09-28 22:29:55 by titan