LIST P=12F683, F=INHX8M
include "P12F683.inc"
ORG 0x0000
MOVLW 0x00
MOVWF PCLATH
GOTO Label_0001
NOP
Label_0001 CLRF FSR
MOVLW 0x1F
ANDWF STATUS , f
MOVLW 0x71
BSF STATUS , RP0
MOVWF 0x0F
BCF STATUS , RP0
BCF 0x1F , 06
BSF STATUS , RP0
BCF 0x1F , 00
BCF 0x1F , 01
BCF 0x1F , 02
BCF 0x1F , 03
MOVLW 0x07
BCF STATUS , RP0
MOVWF 0x19
BSF STATUS , RP0
CLRF 0x15
BSF OPTION_REG, NOT_RBPU
MOVF OPTION_REG, W
ANDLW 0xC7
IORLW 0x08
MOVWF OPTION_REG
BCF STATUS , RP0
CLRF 0x10
MOVLW 0x00
MOVWF 0x21
MOVWF 0x12
MOVLW 0x00
BSF STATUS , RP0
MOVWF 0x12
MOVLW 0x07
BCF STATUS , RP0
MOVWF 0x19
BSF STATUS , RP0
MOVF TRISA , W
MOVLW 0x06
BCF STATUS , RP0
MOVWF 0x20
Label_0002 DECFSZ 0x20 , f
GOTO Label_0002
NOP
MOVF 0x19 , W
BCF 0x0C , 03
BSF STATUS , RP0
CLRF 0x19
MOVLW 0x01
MOVWF 0x0F
BCF STATUS , RP0
CLRF 0x26
BSF STATUS , RP0
BCF TRISA , 04
BCF STATUS , RP0
BCF PORTA , 04
BSF STATUS , RP0
BCF TRISA , 05
BCF STATUS , RP0
BSF PORTA , 05
Label_0004 MOVF 0x26 , f
BTFSS STATUS , Z
GOTO Label_0003
MOVLW 0x32
MOVWF 0x26
BSF STATUS , RP0
BCF TRISA , 04
MOVLW 0x10
BCF STATUS , RP0
XORWF PORTA , f
BSF STATUS , RP0
BCF TRISA , 05
MOVLW 0x20
BCF STATUS , RP0
XORWF PORTA , f
Label_0003 DECF 0x26 , f
GOTO Label_0004
SLEEP
ORG 0x2000
DATA 0x0F
DATA 0x0F
DATA 0x0F
DATA 0x0F
ORG 0x2007
DATA 0x14
It would take about an hour to define the registers used and conceptually determine what the code is trying to do. There is not much to it. It is not my code, it doesnt use the hardware interupt area.