> > What about a "goto $" at the end? > > What happens with a "goto $"? The code below will not stop after the movwf portc, and probably wrap around to the start vector (after executing many addlw 0xff). goto $ will make it wait in a loop. goto $x adds x to the PC. So goto $+2 jumps over the next instruction (16F or less) etc goto $-2 jumps over the previous instruction (16F or less) etc goto $ should be used with caution. Usually safe if you're in a particular fixed loop, eg next, but beware of inserting code into goto $ loops btfss adcon0,go_done goto $-1 ;loop until adcon0,go_done = 1 ; 16F btfss adcon0,go_done goto $-2 ;loop until adcon0,go_done = 1 ; 18F goto $ can be written as goto $-0 or goto $+0 (not goto $0) movlw b'00000000' ; tris porta ; tris portb ; tris portc ; movlw b'11111111' ; movwf porta ; movwf portb ; movwf portc ; wait goto wait ; goto $ or goto $+0 END ; -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist