Hi Brendan, All you need to do is to put the definitions into an .INC file and then include that into all .ASM files you would need to use those defs from. It is very similar what you would do with an .H file if you were programming in C. Tam=E1s On 3/12/10, Brendan Gillatt wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello list, > > I'm developing a multi-module MPASM project and have run into a bit of a > problem. > > Say I have two modules, each requiring the use of a constant, 0xAA in > this case. I could put > > | > | constant testconst =3D 0xAA > | > > or > > | > |testconst equ 0xAA > | > > in both files but this is obviously not very elegant or easy to maintain. > > I have tried to define the constant--using both methods above--and using > GLOBAL and EXTERN statements to "share" the constant between modules as I > would with variable and code labels. This causes MPASM to throw: > > "Duplicate label ("testconst" or redefining symbol that cannot be > redefined)" > > I could put the testconst in a .inc file and include in both modules, but > this seems like overkill just for the odd constant. > > Is there a proper way to do this? > > Thanks, > Brendan > - -- > Brendan Gillatt | GPG Key: 0xBF6A0D94 > brendan {a} brendangillatt (dot) co (dot) uk > http://www.brendangillatt.co.uk > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (MingW32) > > iD8DBQFLmsXOHEhZ5Ws5poERAvC0AJ9a+BZarKdXjHjSDajTaI8bTH8AKQCeJh90 > q4tk5LtCH/fgH1UgKEM5224=3D > =3D9Js9 > -----END PGP SIGNATURE----- > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = Sent from my mobile device int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist