|
|
View previous topic :: View next topic |
Author |
Message |
Boyce
Joined: 07 Feb 2010 Posts: 39
|
General Purpose Register question |
Posted: Thu Feb 18, 2010 9:35 pm |
|
|
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 _________________ [email protected] |
|
|
Ttelmah Guest
|
|
Posted: Fri Feb 19, 2010 3:25 am |
|
|
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
|
|
Posted: Fri Feb 19, 2010 6:03 am |
|
|
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 _________________ [email protected] |
|
|
Ttelmah Guest
|
|
Posted: Fri Feb 19, 2010 6:18 am |
|
|
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 |
|
|
|
|
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
|