;*************************************************************** title "PIC Sample code: PIC16F84A program" subtitle "Version 1.0 (c) Jay.slovak" ;Designed for 16F84A @4Mhz ;*************************************************************** list p=16F84A #include __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC ERRORLEVEL -302 ;*************************************************************** z1 equ 0Ch z2 equ 0Dh z3 equ 0Eh z4 equ 0Fh ;*************************************************************** org 0x0000 goto INIT NOP NOP NOP NOP org 0x0005 INIT CLRF PORTA CLRF PORTB BSF STATUS,RP0 ;Select Bank 1 CLRF TRISA ;Port A is output CLRF TRISB ;Port B is output BCF STATUS,RP0 ;Select Bank 0 Start MOVLW 0xFF MOVWF PORTA MOVWF PORTB CALL Delay CLRF PORTA CLRF PORTB CALL Delay GOTO Start ;*************************************************************** ;*************************************************************** subtitle "Delay subprogram" Delay movlw D'3' movwf z3 movlw D'137' movwf z2 decfsz z1,f goto $-1 decfsz z2,f goto $-3 decfsz z3,f goto $-5 return END