I am a new to PICs programming and am into it as a hobby. I am looking for a delay loop. Attached with this email is the code generated by http://www.piclist.com/techref/microchip/delays.htm as mentioned in one of previous emails for the subject. I do not understand some of the code. Will you be kind enough to clear the problems I am facing. The Problems are mentioned in order of occurrence below: Problem no 1: Mentioned is Actual delay = 0.5 seconds = 500000 cycles What I do not understand is that the clock speed is 4000,000 CPS. With this speed, the cycles for 0.5 seconds delay should have been = 4000,000/2=2000,000 Cycles. Problem no 2: What is cblock? Problem no 3: What is $+1? Problem no 3: How is it mentioned 2 cycles & 4 cycles? ; Delay = 0.5 seconds ; Clock frequency = 4 MHz ; Actual delay = 0.5 seconds = 500000 cycles ; Error = 0 % cblock d1 d2 d3 endc Delay ;499994 cycles movlw 0x03 movwf d1 movlw 0x18 movwf d2 movlw 0x02 movwf d3 Delay_0 decfsz d1, f goto $+2 decfsz d2, f goto $+2 decfsz d3, f goto Delay_0 ;2 cycles goto $+1 ;4 cycles (including call) return UbaidUllah -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body