Hi there,

How to specify include path when include file is in lower directory?

In c it would be "../somedir/somefile.h"
Posted on 2004-05-18 05:11:01 by Ulterior
Hi Ulterior

With masm include you can use absolute or relative paths.

include ..\..\mypath\myinc1.inc
include ../../mypath/myinc2.inc
include C.\myinc\myinc3.inc

You can also use enviroment variables or setup default paths.

KetilO
Posted on 2004-05-18 05:36:04 by KetilO
Hi, Ketil,

I can't get it to work with your posted absolute path's examples

I have app_macros.asm file in main project directory and I try to include
this file from module file located in upper Mod directory.

include ../app_macros.asm
include ..\app_macros.asm

Mod\WINSOCK_FRAMEWORK.asm(15) : fatal error A1000: cannot open file : ..\app_macros.asm

:(

One more question.

In what segment, code, data, or other to store macros? I have seen there is a combo selection for macros.
Posted on 2004-05-20 01:12:14 by Ulterior
The best thing would be if you provided both paths. The basic usage of '..' comes from the old DOS age (the good old days). Below i will show you some simple explainations.

.. <> go up by one folder
..\.. <> go up by two folder

In other words they go up one folder by each double dots '..', but you need to use ' \ ' to seperate.
Ex. "..\..\..\..\..\Include\Insane.inc"

If you want to reach files in subfolders you would instead use something like:
".\mod\include\my.inc" or "mod\include\my.inc"


Macro's are not really stored anywhere except at the location you ask for it. You can write a macro inside any segment as a macro is never included in an compiled file. They are just expanded once used.



...
...
.anysegment
mysuper macro y
mov eax,y
add eax, 54
exitm <eax>
endm

.code
mysuper y ;// This will be replaced by the assembly code generated in the macro.
;// wherever you execute a macro in your code, you will replace it by all
;// the code generated by the macro. Thats also why its somtimes better
;// to use a procedure for certain things instead of Macros.
...
...
Posted on 2004-06-02 03:30:35 by fisk