>-----Original Message----- >From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] >Sent: 08 January 2005 14:05 >To: Microcontroller discussion list - Public. >Subject: Re: [PIC]: Assembly Language Integration with HI-TECH C > > >Bob Ammerman wrote: > >> Of course this doesn't support re-entrancy or recursion, and can get >> messy >> if the same function is called from an interrupt and mainline code. > >In the case of the Hi-Tech PICC/PICC-18, calling functions >from an ISR and from main code can get messy, but doesn't have >to. By default it is not allowed; the compiler creates a call >tree for main and one for each interrupt vector, and there are >no common functions allowed in different call trees. Actually, it IS allowed under very specific circumstances. If the function uses no local variables, and has either no arguments or one argument of type char (i.e. fits in W reg), then PICC will happily let you call the function from the main loop and in the ISR. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist