#include "p10f200.inc" ; CONFIG __CONFIG _WDT_OFF & _CP_OFF & _MCLRE_OFF ORG 0x0000 INIT MOVLW ~(1 << T0CS) ; enable GPIO2 OPTION MOVLW ~(1 << GP2) ; set and GP2 as an output TRIS GPIO LOOP BSF GPIO, GP2 ; set GP2 CALL DELAY ; call DELAY subroutine BCF GPIO, GP2 ; reset GP2 CALL DELAY ; call DELAY subroutine GOTO LOOP ; loop forever DELAY ; start DELAY subroutine here MOVLW D'162' ; load initial value for the delay MOVWF 10 ; copy the value to the register 0x10 MOVWF 11 ; copy the value to the register 0x11 DELAY_LOOP ; start delay loop DECFSZ 10, F ; decrement the register 0x10 and check if not zero GOTO DELAY_LOOP ; if not then go to the DELAY_LOOP label DECFSZ 11, F ; else decrement the register 0x11, check if it is not 0 GOTO DELAY_LOOP ; if not then go to the DELAY_LOOP label RETLW 0 ; else return from the subroutine END