My project is getting bigger, how would I put all my proc's into their own file, constants into 1 file? right now I have everything in 1 asm file, I have about 12 proc's, I want to give them sections, like "file1.inc" which is like 4 proc's, file2.inc which is 5 procs, and file3.inc which is 3 proc's.

Do I just paste them into a plain txt file and then include it? what about .lib files? I am using invoke for the proc's, also what about constants, can I put them all in 1 file and put just call them (Like using windows.inc constants).
Posted on 2003-06-19 16:16:43 by KewLexX
Just make sure to INCLUDE all relevant files.
Posted on 2003-06-19 16:43:39 by bitRAKE
Including files is EXACTLY equivalent to pasting them in 1 file. So this:

FILE1.ASM:
--------cut here---------
include file2.asm
; this is the first file
--------cut here---------

FILE2.ASM:
--------cut here---------
; this is the second file
--------cut here---------

is exactly the same as this:

FILE3.ASM:
--------cut here---------
; this is the second file
; this is the first file
--------cut here---------

For convenience, you can put all your global variables in 1 file, and your code in another file, but it is not necessary to split your project like that. Simply, split your project any way you want :)
Posted on 2003-06-19 16:47:26 by QvasiModo
And remember to INCLUDE them in the correct order ;)
Posted on 2003-06-19 16:49:46 by QvasiModo
or you can use my editor XASM, that does the joining automatically :)
sourcecode and tutorials and all included ;)
Posted on 2003-06-19 17:06:36 by Ultrano
Well,

Lib files are one way to go but if you're not going to use them in a whole bunch of other programs it's kind of a waste of effort to build libs with them. Ofcourse if your program runs into the 100,000+ lines you'll save a little assembly time with libs. Generally you can keep the .asm extension and just include the files, .inc is not really necessary. I usually have one main include file that does all of the windows includes and libs as well as the prototypes, this one I put first then I follow that with the asm files...

>>> mysource.asm
.586
.model flat, stdcall ;32 bit memory model
option casemap :none

include mysource.inc ; main include file
include mydata.inc ; global data needed by all modules (i.e. hinst, hdlg etc..)
include module1.asm
include module2.asm
include module3.asm

.data
; data only needed by this module
.code
start:

end start
Posted on 2003-06-19 17:06:55 by donkey
Ok I got the proto's and const's down, but for proc's, do I need to put .code or something?

file_name.inc
--------contains---------
name proc x:DWORD, Y:DWORD
bla bla
ret
name endp

name2 proc x:DWORD, Y:DWORD
bla bla
ret
name2 endp

-------------------------------

that's what I have so far, it says something about code segment
Posted on 2003-06-19 19:46:35 by KewLexX
Just ensure that they are in the correct segment. If they are not, put the .code thingy.

Anyway for me I have one data.inc to store the data, misc.inc to store the functions that I wrote and I call frequently, then xxx.asm for the real project name. I use something like:



.686
.686
.model flat, stdcall
option casemap:none

include /masm32/include/kernel32.inc
include /masm32/include/user32.inc
include /masm32/include/windows.inc
include test2.inc
includelib /masm32/lib/kernel32.lib
includelib /masm32/lib/user32.lib

.data
include data.inc

.code
start:
...

include misc.inic

end start
Posted on 2003-06-19 21:32:54 by roticv
I was storing everything on top, I get it, thanks for the help, everyone.
Posted on 2003-06-20 06:47:38 by KewLexX