In ASM51, the following code is every useful:
-------- file1.asm --------- public MAX MAX EQU 10 -------- file2.asm --------- extrn number(MAX) MOV A,#MAX
-------- file2.C ----------- extern code MAX; #define MAX_NUMBER ((unsigned char)&MAX)
Place the #define in a header file and include the header file in c files that use MAX. for instance in file.h #define MAX 10 In file1.c and/or file2.c #include "file.h" if ( count < MAX )