> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Gerhard Fiedler > Sent: Wednesday, February 22, 2006 9:45 PM > To: piclist@mit.edu > Subject: Re: [PIC] 2 questions about 18f4550 > > William Killian wrote: > > > Many compilers designed for embedded or even not allow you to eliminate > > most of the traditional stack frame through optimization phases. One > > could write a C derivative with an extension for embedded work where a > > new keyword would allow a function to be defined as a tasks or reset > > condition entry point that is not called but instead branched to that > > can not return. > > I had a little parsing problem with these two sentences, but maybe this is > pertinent :) > > Some PIC compilers are non-standard in that they don't use a real stack; > they create a static stack (and therefore a static call tree). This limits > some features, but it makes it easily possible that functions that are > called only once are not called, but jumped into, and they don't use a > return, but also a jump out. PICs with their very small RAM space are not really suitable for standard C approach. Thus the unusual call and return approach. But nothing in the C definition requires the actual call and return assembly instructions be used. As long as it works enough like call and return it is okay. There is an ISO committee working on a standard embedded extension for ISO C (mostly supplanting ANSI C as we're all globalized now and don't need American ownership of the process. Did you know that? Thought you might.) An extension could be something like 'no_return' as in use entry instead of no-return for a function that starts off the whole processor for reboot or any task that can not return - for multi-tasking systems any of the task entry points. Another extension could be forcing this 'function' to an absolute address. That embedded committee is putting in things to allow memory partitioning so that might very well be enough. Something like: noreturn reset (void) { /* do system init stuff */ or (;;) { main_body(); } } ------------------------------------- Notice of Confidentiality ---------------------------------------------------------- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postmaster@vgt.net. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist