cancel
Showing results for 
Search instead for 
Did you mean: 

Define Global Constants

brian4
Associate II
Posted on May 12, 2004 at 10:48

Define Global Constants

3 REPLIES 3
brian4
Associate II
Posted on May 07, 2004 at 15:21

Hi an assembler question.

How do I set a constant so that it can be used in all my asm files

In my main.asm file I have

#define timeint 10

which works fine when the sub that uses timeint is in my main.asm file

I want to create another file called inputs.asm which will have a sub within that will need to use timeint.

apart from adding #define timeint 10 to every asm file is there a common file.

Tried adding it in my include file but not sure of the Syntax.

I am sure there must be a way.

Regards

Brian
sjo
Associate II
Posted on May 12, 2004 at 09:40

Brian,

The simplest way is to use a header file (myheader.inc)

eg. in your header file

#define timeint 10 ; note the space before start of line

making sure to include this header wherever needed

#include ''myheader.inc''

ld A, #timeout

Hope this helps

Regards

sjo
brian4
Associate II
Posted on May 12, 2004 at 10:48

Thanks,

I knew it would be simple, but I could not find it documented

Re Brian