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

function pointers across page boundaries

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







function pointers across page boundaries
PostPosted: Wed Jan 14, 2004 6:05 am     Reply with quote

I have an array of function pointers with 19 items. I call them from main based on a flag. the lower six (members 0 thru 5) do not work. The processor goes off to who knows where. In the list file it shows that these six funcs reside in page 0 and the rest are in page 1. main is in page 1. Obviously the page select bits aren't correct. Interesting side note, when compiled for use with icd it works just fine. Any way what is the solution here? the preprocessor #type *=16 is included. Can i use #org statements
to force the functions into a specific page or is it better to manually set up the page select bits before each call.

Thanks
henry
Guest







PostPosted: Thu Jan 15, 2004 6:10 am     Reply with quote

Since I got no responses i think maybe I didn't make myself clear.

If I understand the PIC data sheet. When a call is made the Program counter provides the lower 11 bits(2K) of the destination address. The upper 2 bits come from PCLATH(4:3). these 2 bits determine wich page to call to. My problem is that these two bits aren't being properly set.
So, My question is: Am i doing something wrong to prevent the compiler(PCM 3.169) from handling this automatically or is this a shortcoming of the compiler when using pointers to functions?

Please help if you can
tahnks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 15, 2004 9:24 am     Reply with quote

The reason I didn't respond or try to test it, is because of Darren Rook's
comment at the end of this thread.

http://www.ccsinfo.com/forum/viewtopic.php?t=17137&highlight=functions+pointers
Guest








PostPosted: Thu Jan 15, 2004 10:16 am     Reply with quote

according to ccs after ver 3.160 function pointers are fully supported.
thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 15, 2004 10:43 am     Reply with quote

Well, Darren works for CCS, so he should know.
I believe him regardless of what the Versions page says.
He made that post on Sept. 6, 2003. By looking in my
download directory, I can see that on that date, CCS
was at about vs. 3.176. So Darren thought they were
still beta at that version. And, they're still not documented.
Look in the current Readme.txt file, or the current manual.
They're not listed.
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