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 support@ccsinfo.com

16bit pointer note

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







16bit pointer note
PostPosted: Sat Jan 24, 2004 12:27 pm     Reply with quote

I had difficulty using function pointers. Perhaps I should have been aware of this but I learned the hard way.
if preprocessor #device *=16 is in your source all variables that index or alter a pointer in any way must also be declared as long or int16. I was trying to index my function pointers with an 8 bit flag because there are only twenty functions. It worked great if the functions were in the same page as the calling func. when the flag is declared as a long variable it works. Even though the upper 8 bits are always zero's. Hope this can prevent some frustration for others.
Guest
Guest







PostPosted: Tue Feb 24, 2004 9:47 am     Reply with quote

Im, the #device *=16 instruction is only to be able to access more than 256 bytes in ram..

8bits pointers can point 0-255 byte in ram...
16bits can point 0-65535
RKnapp



Joined: 23 Feb 2004
Posts: 51

View user's profile Send private message

16-bit pointer note
PostPosted: Tue Feb 24, 2004 12:23 pm     Reply with quote

Wait -- please explain. I'm a newbie using 18F8720 and know I'll need a lot more than 256 bytes of RAM -- I'm trying to compress a giant DOS app to fit into this chip.

So... should I be using #device *= 16?

Thanks for your help!
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