Dimmu
Joined: 01 Jul 2007 Posts: 37
|
Interrupt handler |
Posted: Wed Oct 03, 2007 1:52 pm |
|
|
Hi,
16f876A
pcwh 4.053
Is there a way to reduce the size of the interrupt handler generated by CCS ?
Here is a very simple program that shows the size of the generated code for a simple assignment :
Code: | #include <16F876A.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES PUT //Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES DEBUG //Debug mode for use with ICD
#FUSES BROWNOUT //Reset when brownout detected
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#use delay(clock=20000000)
int i;
#int_TIMER0
void TIMER0_isr(void)
{
i++;
}
void main()
{
}
=================
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 038
0003: NOP
----- default IT handler begin !!
0004: MOVWF 7F
0005: SWAPF 03,W
0006: CLRF 03
0007: MOVWF 21
0008: MOVF 0A,W
0009: MOVWF 20
000A: CLRF 0A
000B: MOVF 04,W
000C: MOVWF 22
000D: MOVF 77,W
000E: MOVWF 23
000F: MOVF 78,W
0010: MOVWF 24
0011: MOVF 79,W
0012: MOVWF 25
0013: MOVF 7A,W
0014: MOVWF 26
0015: MOVF 7B,W
0016: MOVWF 27
0017: BCF 03.7
0018: BCF 03.5
0019: BTFSS 0B.5
001A: GOTO 01D
001B: BTFSC 0B.2
001C: GOTO 030
001D: MOVF 22,W
001E: MOVWF 04
001F: MOVF 23,W
0020: MOVWF 77
0021: MOVF 24,W
0022: MOVWF 78
0023: MOVF 25,W
0024: MOVWF 79
0025: MOVF 26,W
0026: MOVWF 7A
0027: MOVF 27,W
0028: MOVWF 7B
0029: MOVF 20,W
002A: MOVWF 0A
002B: SWAPF 21,W
002C: MOVWF 03
002D: SWAPF 7F,F
002E: SWAPF 7F,W
002F: RETFIE
--- default it handler end !!
0030: BCF 0A.3
0031: BCF 0A.4
0032: GOTO 033
.................... int i;
....................
.................... #int_TIMER0
.................... void TIMER0_isr(void)
.................... {
.................... i++;
0033: INCF 28,F
.................... }
....................
....................
0034: BCF 0B.2
0035: BCF 0A.3
0036: BCF 0A.4
0037: GOTO 01D
.................... void main()
.................... {
0038: CLRF 04
0039: BCF 03.7
003A: MOVLW 1F
003B: ANDWF 03,F
003C: BSF 03.5
003D: BSF 1F.0
003E: BSF 1F.1
003F: BSF 1F.2
0040: BCF 1F.3
0041: MOVLW 07
0042: MOVWF 1C
.................... }
0043: SLEEP
Configuration Fuses:
Word 1: 3772 HS NOWDT PUT DEBUG NOPROTECT BROWNOUT NOLVP NOCPD NOWRT
|
Thanks
Dimmu |
|