where timer1, timer2, and timer3 are the 3 variablesFLASHDEL MOVLW D'255'
FLD1 MOVWF TIMER1
FLD2 DECFSZ TIMER1,F
RFDELAY MOVLW D'30'
RFDL CALL FLASHDEL
PULSEDEL MOVLW D'225' ;TIMER 1 VALUE THE LARGER THE LONGER THE DELAY
PDLOO DECFSZ TIMER1,F
delay_ms(500); or dellay_us(500);
herepulsedel movlw d'255'
is the lable of the routine, wen ever u need to call it, the instruction wud be "pusedel
', that means mov decimal 255 or hex ff or binary 11111111 to accumulatormovlw d'255
" , means move the contents of accumuator to the variable named timer1, so timer1 holds a value 255 in it..movwf timer1
is a label, next command ispdloo
, that means decrement the file named as timer1 by 1, ,f means the result after decrementation shud be kept in the timer1 file, but if after decrement the file gets 0 then skip the very next command, so decrement keeps happening till the timer1 gets zeror and cpu jumps to pdloo everytime, but as the file gets 0 the cpu skippes goto command and the routine quits... decfsz means decrements file but skip next command if file gets 0..decfsz timer1,f