
Originally Posted by
Acetronics
Hi, Darrel
I Was a bit surprised by those lines :
...
are those 6 times " GOTO _GetCH_2 " ( L368 , 370 - 373 , 378 ) something " regular " ???
The lines showing the same labels is the result of Disassembling.
There are actually 6 different labels, with the code in-between optimized out since the chip doesn't have 5 CCP modules.
It comes from this section ...
Code:
;----- Get Current DutyCycle ------------------------------------------------
Branch HP_Channel,[GetCH_Done,GetCH_1,GetCH_2,GetCH_3,GetCH_4,GetCH_5]
GetCH_1:
ASM
ifdef CCP1CON
MOVE?BB CCPR1L, _HP_Temp
MOVE?BB CCP1CON, _HP_Temp + 1
goto _GetCH_Done
endif
endasm
GetCH_2:
ASM
ifdef CCP2CON
MOVE?BB CCPR2L, _HP_Temp
MOVE?BB CCP2CON, _HP_Temp + 1
goto _GetCH_Done
endif
endasm
The GOTO's are created by the Branch statement.
And it looks like this in the .LST file ...
Code:
016B 3001 M movlw (jmptbl) >> 8
016C 008A M movwf PCLATH
016D 084C M movf _HP_Channel, W
016E 0782 M addwf PCL, F
016F M jmptbl
016F 297A M goto _GetCH_Done
0170 2975 M goto _GetCH_1
0171 297A M goto _GetCH_2
0172 297A M goto _GetCH_3
0173 297A M goto _GetCH_4
0174 297A M goto _GetCH_5
0175 M L00001
0175 M _GetCH_1
0175 0813 M movf CCPR1L, W
0176 00C0 M movwf _HP_Temp
0177 0815 M movf CCP1CON, W
0178 00C1 M movwf _HP_Temp + 1
0179 297A 00326 goto _GetCH_Done
017A M _GetCH_2
017A M _GetCH_3
017A M _GetCH_4
017A M _GetCH_5
017A M _GetCH_Done
Since the labels are all at the same address, the disassembler chooses the first label it finds at that address (_GetCH_2).
Bookmarks