CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

label_address() doesn't give full address when parsing

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Honken



Joined: 03 Mar 2004
Posts: 15

View user's profile Send private message

label_address() doesn't give full address when parsing
PostPosted: Tue Oct 10, 2006 3:30 am     Reply with quote

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
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group