To some degree it is up to the compiler, but it could just run lose and eventualy (when the program counter has wrapped around) end up re-starting the application. Jan-Erik. Dave Harris wrote 2011-12-11 22:43: > Hi All. > > I know I should not let it happen, but I'm curious... > In Hitech C code on a PIC (or others) what happens if main() exits? > > Dave --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .