The code i wrote below was taken out of another program i was working on but hav ing trouble with the delay routine. When i simulate it with MPLAB by stepping t hrough line for line i notice that in the countdown loop for the delay when the variable INNER = 0, it should execute the line "bcf PORTA, 0"..instead it jumps to address 0X004. The program is written as i simulated it i also tried setting the Option register to 0 as well as intcon, still jumps to address h004. Any i deas? maybe an error in my coding that im overlooking. list P=16C84 include "p16c84.inc" RADIX DEC INNER equ 11 OUTER equ 12 movlw 0 movwf INTCON movlw 0 tris PORTA clrf PORTA bsf PORTA, 0 movlw 5 Delay movwf OUTER ; loop (w) times outerl call delayms ; at 1ms each decfsz OUTER,f goto outerl return delayms movlw 0xC7 ; Set the inner movwf INNER ; count innerl nop ; 5 cycles loop nop ; until done decfsz INNER,f goto innerl bcf PORTA, 1 END MiKe Send someone a cool Dynamitemail flashcard greeting!! And get rewarded. GO AHEAD! http://cards.dynamitemail.com/index.php3?rid=fc-41