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

pic16F876 and stack overflow

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







pic16F876 and stack overflow
PostPosted: Tue Jul 27, 2004 8:37 pm     Reply with quote

Hi,
CCS produces following header in the .LST file:

CCS PCM C Compiler, Version 2.732, 2680

Filename: D:\DEVELOP\PIC\PICC\DONSA4\DONSA4.LST

ROM used: 6821 (83%)
Largest free fragment is 778
RAM used: 75 (20%) at main() level
207 (56%) worst case
Stack: 8 worst case (4 in main + 4 for interrupts)

Here is my question. Is the interrupt call itself counted as 1 extra stack depth and not included in the "8 worse case" count?

Puzzled
Haplo



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

View user's profile Send private message

PostPosted: Tue Jul 27, 2004 9:43 pm     Reply with quote

The interrupt has already been counted, although your compiler is pretty old and it might have been different in the old days.
Here is what I got in the .LST file when I compiled one of my codes without any interrupts:

Quote:

ROM used: 1747 (46%)
Largest free fragment is 2048
RAM used: 66 (37%) at main() level
87 (48%) worst case
Stack: 6 locations


And with one interrupt added:

Quote:

ROM used: 1859 (48%)
Largest free fragment is 2048
RAM used: 75 (42%) at main() level
97 (54%) worst case
Stack: 7 worst case (6 in main + 1 for interrupts)
Mark M
Guest







PostPosted: Wed Jul 28, 2004 10:32 am     Reply with quote

Thanks Ali, I wonder if it is worthwhile to buy a new compiler. I have purchased the PCH for one project and found the same optimizer defficecies as my old PCM 2.72 and therefore I found no reason to upgrade the PCM. But may be there is something else...

Mark
Haplo



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

View user's profile Send private message

PostPosted: Wed Jul 28, 2004 5:37 pm     Reply with quote

Well PCM 2.72 is *very* old. Personally I have not used anything older than PCM 3.112, so I can't comment on that. However, this page might be useful:

http://www.ccsinfo.com/versions.shtml
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