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

#reserve, #locate, #zero_ram

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



Joined: 05 Apr 2004
Posts: 1

View user's profile Send private message

#reserve, #locate, #zero_ram
PostPosted: Mon Apr 05, 2004 3:52 pm     Reply with quote

Hi all. I have come across a little oddity in my application that I'm hoping someone here can help shed some light on. I have implemented a bootloader and have used the #reserve and #locate pre-processor directives to keep my bootloader's variables at the same address location between builds. That works fine. The problem comes in when I use the #zero_ram directive. This appears to skip the #locate'd memory areas.

Here is an example:

char ch1;
char ch2;
.
.
.

#zero_ram
#reserve 0xD00:0xEFF

#locate ch1 = 0xD00
#locate ch2 = 0xD01
.
.
.


This snippet will initialize all but the #locate'd memory space.

I guess my question is this: Is there a CCS directive (or a better use of the above directives) that will allow the #locate'd or #reserve'd RAM to be included in the #zero_ram directive's scope or am I stuck writing my own code to accomplish this (which isn't difficult, but shouldn't be necessary)?

BTW: I'm using build 3.187 inside of MPLAB, target is 18F8720

Thank you in advance.
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Mon Apr 05, 2004 5:15 pm     Reply with quote

Both #locate and #reserve stop the compiler from using that specific memory area. There are ways around it, for example by using #byte instead of #locate. But then this won't stop the compiler from using that memory location. Whether this is acceptable or not depends on your application.
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