Access variable declared in C from asm. | Cypress Semiconductor
Access variable declared in C from asm.
If I have a variable declared in a C file as;
volatile long seconds;
and want to access that from a timer interrupt ISR in asm to increment it, how do I go about that?
The compiler is complaining about not knowing what seconds is in the asm file (undefined symbol). So how can I define it in the asm file?
At the moment I'm doing something like
and F, 0x00 ;
inc [seconds] ;
jnc _end ;
And the same for each subsequent byte [seconds+1, 2 & 3].
Is this the "right" way? Or is there a better way?