Hi,
I'm trying desperately to access the address of a C structure in a assembly file.
E.g. if I have the .c file:
typedef struct { uint8_t a; uint8_t b; } status_t; volatile status_t status;
and the .S file
.extern status .global TWI_vect TWI_vect: push r30 push r31 ldi r30, lo8(status) ldi r31, hi8(status) ... pop r31 pop r30 reti
then I get the linker error (undefined symbol 'status').
But the symbol is defined; if I list the symbols with avr-nm, then I get:
008000ae b status.2474
I'm aware of the trick to reserve a register to be used only in the ISR, but I don't want to limit the number of registers in the C code.
I have also tried to define the structure as:
volatile status_t status asm("ASMSTRUCT");
but neither ASMSTRUCT was defined.
How is it possible to get the base address of my structure in a .S file?
Cheers,
Thomas