Accessing C global variable from assembly file
Hi all,
I am trying to access a C variable from an assembly file but I am getting an "undefined reference" error in the assembly file's line in which I am trying to access the variable. I am using GCC and GAS by the way.
Code:
test.c
uint8_t test_variable=0;
extern uint8_t test_variable;
Code:
test.S
...
...
movb $0xA5,%al
movb %al,($test_variable)
...
...
The error received is the following:
Code:
undefined reference to `$test_variable'
Any help will be really appreciated as I struggle with this for days.