View previous topic :: View next topic |
Author |
Message |
bungee-
Joined: 27 Jun 2007 Posts: 206
|
General library |
Posted: Tue May 05, 2009 5:21 pm |
|
|
In time, my programming "library" is growing. I was wodering if it would be good idea, to put all "general" functions (not dependant of HW) to one place.
The dilema I face are const types. Are they put into the PIC memory only as need to have basis or are they all put into the hex. I would think that it is first option, that is in use.
I was looking at LST files, but I did not find even the used const type there.
Anybody know this answer? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue May 05, 2009 5:42 pm |
|
|
To see the 'const' array data in your .LST file, comment out the #nolist
statement in your PIC's .h file. The re-compile. Example:
Quote: |
//////// Standard Header file for the PIC16F877 device /////
#device PIC16F877
//#nolist
|
Also, see these rules of how or whether const array data appears in
the .LST file:
http://www.ccsinfo.com/forum/viewtopic.php?t=38006&start=1 |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue May 05, 2009 5:48 pm |
|
|
Or have a look at the symbol file (*.sym).
A variable not present in this file means it takes no memory. |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Wed May 06, 2009 12:11 am |
|
|
Commenting out the #nolist directive didn't do the trick. I can see the constant in the listing as C directive, but no asm beside that.
Sym shows only one constant of two in my program and the shown is used. So my assumption was correct. Constant is put in the binary file on need to have basis.
Thank you for help. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed May 06, 2009 2:37 am |
|
|
ROM constants have the start address of their associated function listed in the ROM Allocation section of the *.sym file. But there's no respective symbol in the asm listing.
No functions and table data are generated for unreferenced constants. |
|
|
|