The stack is corrupted (being a stack, the first address pushed will be lost), and you will notice the affect on a return from call ... The PIC will not return where you expect it, and will jump to another completely incorrect point in code, with resulting unpredictable behaviour. If you are having trouble finding the overflow (they can be hard to debug), use MPLAB's simulator to help you monitor the stack. Hope this helps. Rgs Ian. -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of TAN WH Sent: Monday, 13 October 2003 10:40 am To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: Stack overflow Hi, may someone please explain this to me. I am suspecting that there is a stack overflow in my PIC16F877. So I would like to know what will happen to a PIC when a stack overflow occur. Thanks & regards. WH Tan -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body