Honken
Joined: 03 Mar 2004 Posts: 15
|
label_address() doesn't give full address when parsing |
Posted: Tue Oct 10, 2006 3:30 am |
|
|
When I parse the label_address() within a function like the one below the address get cut.
The constant variable "f1" is located at address 0x041A.
But in the test function I only got address 0x001A.
When I try with moving the label address to a variable outside the function and the parsing the address variable it works.
---- NOT WORKING ---
test(label_address(f1), 1);
void test(int16 addr, int last)
{
char D = 0;
D = read_program_eeprom(addr); // <- WRONG ADDRESS 0x001A
}
---- WORKING ---
int16 a = 0;
a = label_address(f1);
test(a, 1);
void test(int16 addr, int last)
{
char D = 0;
D = read_program_eeprom(addr); // <- OK, ADDRESS 0x041A
} |
|