William Chops Westfield wrote: > > You guys seem to be saying that it's possible to write > a C program that won't run on the PIC after it's compiled, > because you may exceed the stack size. Is this true? > > Yes, of course it's true. As far as I know, ANY C compiler for ANY > processor can produce code that overflows the stack. I don't THINK there > are any that actually try to guess what the stack size SHOULD be, and of > course it's not possible to predict the amount of run-time recursion. > It *IS* possible in this case - there is NONE. CCS compilers re-use memory as long as it can be re-used. The only exception to this is a routine which is marked as an interrupt service routine. Recursion is not allowed. As has been pointed out by others, the only recourse to make it fit is inlining at the appropriate point and the compiler will give you a call tree, so it's a simple task. I've used the 16F84 and the CCS compiler as an example for my compiler construction course, the students still find it amazing that the MCU only has a few bytes of RAM and you can compile code for it :-) /Kevin -- Kevin J. Maciunas Net: kevin@cs.adelaide.edu.au Dept. of Computer Science Ph : +61 8 8303 5845 University of Adelaide Fax: +61 8 8303 4366 Adelaide 5005 SOUTH AUSTRALIA -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu