> A C compiler inserts code in your program that does initialization > (the "crt0" that someone mentioned), calls main() as a function with > the appropriate arguments (if any), and then cleans up. In this case, > "cleaning up" apparently means executing a software reset instruction, > which is not at all a bad idea (if your processor HAS a reset > instruction!) The trouble here is that C does not define what an embedded (barew metal) compiler should do after main(), so each compiler makes his own choice. The two obvious choices are: - restart - sit in a tight loop but there is no guarantee that a different compiler won't make a different choice. So for this aspect you'd better not rely on the compiler but insert the appropriate code yourself. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist