Sebastian Irazabal

Sharing Labels between C and Assembler

Discussion created by Sebastian Irazabal on Jul 19, 2007
Latest reply on Jul 19, 2007 by CompilerGuru
Hello Everybody!!

I'm here again because I'm improving some code donde before and I'm trying to make it easy to read, I'm trying to make it more "friendly"....
My question is: Is there any way to use the same labels (macro declarations) in C and Assembler?

What I was doing before was:

in ASM:
    pin_1      equ     $04
    port_!     equ     PORTA

in C:
    #define     PIN_1           $04
    #define     PORT_1      PORTA

So I was refering to the same pin both in C and ASM, and to distinguish C from ASM I use UPPER CASE for C and lower case for ASM....

I hope you could help me with that....

So I can define in C:
    #define     pin_1           $04
    #define     port_1          PORTA

and use it in ASM like:
    BSET   port_1,pin_1