ALERTLINKS
Advanced Member level 4
I only have the count code which is in hex for now...
Here is disassembly of count2.hex,
Code:
processor 16F676
Radix DEC
#include "P16F676.INC"
__CONFIG 0x31F4
ERRORLEVEL -302
ORG 0
GOTO L174
L1:
MOVWF 52
CALL L63
MOVF 32,0
IORWF 33,0
BTFSC STATUS,Z
GOTO L169
CALL L163
BCF FSR,7
MOVF 52,0
XORWF INDF,1
L11:
CLRWDT
GOTO L13
L13:
GOTO L14
L14:
INCF 32,1
BTFSC STATUS,Z
INCFSZ 33,1
GOTO L11
XORWF INDF,1
GOTO L169
MOVLW 8
L21:
MOVWF 38
MOVF 55,0
MOVWF FSR
MOVF 53,0
BTFSC 51,2
CALL L58
BTFSS 51,2
CALL L60
MOVF 54,0
MOVWF FSR
COMF 52,0
CALL L64
MOVF 38,0
BTFSC STATUS,Z
GOTO L169
BTFSC 51,0
CALL L126
L38:
MOVF 54,0
MOVWF FSR
RRF 33,1
RRF 32,1
MOVF INDF,0
IORWF 52,0
BTFSS STATUS,C
XORWF 52,0
MOVWF INDF
CALL L51
DECFSZ 38,1
GOTO L38
GOTO L169
L51:
MOVF 55,0
MOVWF FSR
MOVF 53,0
XORWF INDF,1
NOP
XORWF INDF,1
RETURN
L58:
IORWF INDF,1
GOTO L63
L60:
XORLW 255
ANDWF INDF,1
GOTO L64
L63:
XORLW 255
L64:
BSF FSR,7
ANDWF INDF,1
GOTO L169
L67:
ANDLW 15
MOVWF 32
BCF STATUS,C
RLF 32,1
RLF 32,1
MOVF ADCON0,0
ANDLW 224
IORWF 32,0
IORLW 1
MOVWF ADCON0
MOVLW 0
MOVWF 33
MOVLW 50
CALL L106
BSF ADCON0,GODONE
L82:
BTFSC ADCON0,GODONE
GOTO L82
CLRF 33
MOVF ADRESH,0
GOTO L169
L87:
BSF STATUS,RP0
MOVWF EEADR
BSF EECON1,RD
MOVF EEDAT,0
GOTO L169
CLRF 163
L93:
MOVWF 162
L94:
MOVLW 255
ADDWF 162,1
BTFSS STATUS,C
ADDWF 163,1
BTFSS STATUS,C
GOTO L169
MOVLW 3
MOVWF 161
MOVLW 223
CALL L106
GOTO L94
CLRF 161
L106:
ADDLW 232
MOVWF 160
COMF 161,1
MOVLW 252
BTFSS STATUS,C
GOTO L115
L112:
ADDWF 160,1
BTFSC STATUS,C
GOTO L112
L115:
ADDWF 160,1
CLRWDT
INCFSZ 161,1
GOTO L112
BTFSC 160,0
GOTO L121
L121:
BTFSS 160,1
GOTO L125
NOP
GOTO L125
L125:
RETURN
L126:
CLRF 162
CLRF 163
GOTO L133
L129:
RRF 161,1
RRF 160,1
RLF 162,1
RLF 163,1
L133:
ADDLW 255
BTFSC STATUS,C
GOTO L129
MOVF 163,0
MOVWF 161
MOVF 162,0
MOVWF 160
GOTO L169
L141:
MOVLW 16
MOVWF 168
CLRF 161
CLRF 160
L145:
RRF 167,1
RRF 166,1
BTFSS STATUS,C
GOTO L155
MOVF 162,0
ADDWF 160,1
MOVF 163,0
BTFSC STATUS,C
INCFSZ 163,0
ADDWF 161,1
L155:
RRF 161,1
RRF 160,1
RRF 165,1
RRF 164,1
DECFSZ 168,1
GOTO L145
MOVF 164,0
GOTO L169
L163:
COMF 160,1
COMF 161,1
INCF 160,1
BTFSC STATUS,Z
INCF 161,1
RETURN
L169:
BCF STATUS,IRP
BCF STATUS,RP1
BCF STATUS,RP0
CLRWDT
RETURN
L174:
BSF STATUS,RP0
CLRF ANSEL
BCF STATUS,RP0
MOVLW 7
MOVWF CMCON
BSF STATUS,RP0
BSF TRISA,3
BSF TRISA,5
BCF TRISA,2
BCF TRISA,1
BCF TRISA,0
BCF STATUS,RP0
L186:
CLRWDT
BTFSS PORTA,5
GOTO L191
GOTO L196
GOTO L192
L191:
GOTO L281
L192:
BCF PORTA,2
BSF STATUS,RP0
BCF TRISA,2
BCF STATUS,RP0
L196:
CLRF 60
L197:
CLRWDT
MOVLW 10
SUBWF 60,0
BTFSC STATUS,C
GOTO L280
CLRF 59
L203:
CLRWDT
MOVLW 10
SUBWF 59,0
BTFSC STATUS,C
GOTO L278
MOVF 59,0
CALL L87
MOVWF 61
MOVLW 3
CALL L67
MOVWF 58
MOVLW 10
MOVWF 38
CLRF 39
MOVF 58,0
MOVWF 34
CLRF 35
CALL L141
MOVWF 56
MOVF 37,0
MOVWF 57
MOVLW 30
ADDWF 56,1
BTFSC STATUS,C
INCF 57,1
MOVF 60,0
CALL L87
MOVWF 62
CLRWDT
BTFSC PORTA,5
GOTO L235
GOTO L281
L235:
MOVLW 5
MOVWF 54
MOVLW 1
MOVWF 52
MOVLW 5
MOVWF 55
MOVLW 2
MOVWF 53
MOVLW 1
MOVWF 51
MOVF 61,0
MOVWF 32
CLRF 33
MOVLW 4
CALL L21
MOVLW 5
MOVWF 54
MOVLW 1
MOVWF 52
MOVLW 5
MOVWF 55
MOVLW 2
MOVWF 53
MOVLW 1
MOVWF 51
MOVF 62,0
MOVWF 32
CLRF 33
MOVLW 4
CALL L21
MOVLW 100
MOVWF 32
CLRF 33
MOVLW 5
MOVWF FSR
MOVLW 4
CALL L1
MOVF 57,0
MOVWF 35
MOVF 56,0
CALL L93
INCFSZ 59,1
GOTO L203
L278:
INCFSZ 60,1
GOTO L197
L280:
GOTO L186
L281:
BCF PORTA,2
BSF STATUS,RP0
BCF TRISA,2
BCF STATUS,RP0
MOVLW 9
MOVWF 60
L287:
MOVLW 9
MOVWF 59
L289:
MOVF 59,0
CALL L87
MOVWF 61
MOVLW 3
CALL L67
MOVWF 58
MOVLW 10
MOVWF 38
CLRF 39
MOVF 58,0
MOVWF 34
CLRF 35
CALL L141
MOVWF 56
MOVF 37,0
MOVWF 57
MOVLW 30
ADDWF 56,1
BTFSC STATUS,C
INCF 57,1
MOVF 60,0
CALL L87
MOVWF 62
CLRWDT
BTFSS PORTA,5
GOTO L316
GOTO L186
L316:
MOVLW 5
MOVWF 54
MOVLW 1
MOVWF 52
MOVLW 5
MOVWF 55
MOVLW 2
MOVWF 53
MOVLW 1
MOVWF 51
MOVF 61,0
MOVWF 32
CLRF 33
MOVLW 4
CALL L21
MOVLW 5
MOVWF 54
MOVLW 1
MOVWF 52
MOVLW 5
MOVWF 55
MOVLW 2
MOVWF 53
MOVLW 1
MOVWF 51
MOVF 62,0
MOVWF 32
CLRF 33
MOVLW 4
CALL L21
MOVLW 100
MOVWF 32
CLRF 33
MOVLW 5
MOVWF FSR
MOVLW 4
CALL L1
MOVF 57,0
MOVWF 35
MOVF 56,0
CALL L93
MOVLW 1
SUBWF 59,1
BTFSC STATUS,C
GOTO L289
MOVLW 1
SUBWF 60,1
BTFSC STATUS,C
GOTO L287
GOTO L186
ORG 0x2100
DE 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
END
and converted to asm file. Unzip and open with notepad or into Mplab.
Attachments
Last edited: