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

General Purpose Register question

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



Joined: 07 Feb 2010
Posts: 39

View user's profile Send private message

General Purpose Register question
PostPosted: Thu Feb 18, 2010 9:35 pm     Reply with quote

At the end of the 16F690 Special Function Register list is a set called General Purpose Register.
I am guessing that the general purpose register is used when variables are declared in C.
True?
If not, how is the General Purpose Register used?
Thanks,
Boyce
_________________
boyceg1@gmail.com
Ttelmah
Guest







PostPosted: Fri Feb 19, 2010 3:25 am     Reply with quote

Almost....
This is the chip's RAM memory. It is used for _everything_ requiring dynamic data storage. Temporary values during arithmetic, storing copies of the special function registers during interrupts, storing copies of variables, when calling routines, and the variables themselves.
So, 'yes' this is where the variables go, but a lot of other stuff as well....

If you open the .LST file generated when you compile a program, at about the 7th line down, you will see a pair of lines, with the first starting, "RAM used:". This shows how much of the RAM is being used!.

The '.sym' file, gives the actual locations used for specific items.

It is almost a slight 'misprint' in the data sheet, since this is a block of 'General purpose registers' (note the plural), rather than a single 'General purpose register'. The sheet entry for the smallest processor has the plural, but it is omitted for the larger chips.....

Best Wishes
Boyce



Joined: 07 Feb 2010
Posts: 39

View user's profile Send private message

PostPosted: Fri Feb 19, 2010 6:03 am     Reply with quote

Ttelmah wrote:
Almost....
This is the chip's RAM memory. It is used for _everything_ requiring dynamic data storage. Temporary values during arithmetic, storing copies of the special function registers during interrupts, storing copies of variables, when calling routines, and the variables themselves.
So, 'yes' this is where the variables go, but a lot of other stuff as well..

It appears that I don't need to concern myself with this issue unless there is a *very* special reason to. Thanks for your usual excellent information.
Boyce
_________________
boyceg1@gmail.com
Ttelmah
Guest







PostPosted: Fri Feb 19, 2010 6:18 am     Reply with quote

Yes.
This is one of the big advantages of using a compiler, rather than working in assembler. It does the 'donkey work' for things like this for you.

Best Wishes
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