Agree...change the $-1 to a real label. Have you used the debugger to single step and watch the PC to see where it might be getting lost at? Maybe pist the list file and take a look at how its setting up the addressing. John Piccirillo wrote:I'm having a tremendous problem with a simple program. It's gotten bizarre. The program works in the MPLAB simulator but not running on a 16F84 (I tried an old 16C84 with the same results). Here's two fragments: one works in the code, the other doesn't. The following works: again: btfsc PORTA, 4 ;check for button press - normal hi goto again ;button not pressed btfss PORTA, 4 ; check button released goto $-1 call debounce ;4 ms time delay The following does NOT work: again: nop nop btfsc PORTA, 4 ;check for button press - normal hi goto again ;button not pressed btfss PORTA, 4 ;check button released goto $-1 call debounce however, using only one nop works. If posting the entire code would help, its not long, I'd be glad to do so. Any help is greatly appreciated. John- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist