On Sat, 2 Oct 2004, Herbert Graf wrote: > > Code generated by > > the Hi-Tech compilers jumps back to the beginning after the closing > > brace of main(). > > Are you absolutely certain of that? Yes. > Does HiTech put a "goto" at the end brace? Yes. Here is the assembly listing of the OP's code: 25 03FA 1683 bsf 3,5 26 03FB 0186 clrf 6 ;volatile 27 ;t.c: 13: PORTB = 0xFF; 28 03FC 30FF movlw -1 29 03FD 1283 bcf 3,5 30 03FE 0086 movwf 6 ;volatile 31 ;t.c: 14: } 32 03FF 2804 ljmp start "start" being the C startup code which I haven't included here. > I would be very surprised and disturbed if they did. Why? The standard specifically states that this behavior is implementation-defined. I don't see how having random code executed would be preferrable. > Remember, that if execution DOES go into "never never" land, and all of > that place is uninitialized The latter condition is certainly not likely to be true when discussing what follows the closing brace of main(), except in the most trivial of programs. -- John W. Temples, III _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist