楼主用的是哪个版本的编译器?
你说的循环代码应该不是进出中断的一部分吧?? 应该是你自己的代码吧?????????
看看我的C18 3.16生成的代码,没有循环的代码的部分 58: #pragma code high_vector=0x08 59: void interrupt_at_high_vector(void) 60: { 61: _asm GOTO high_isr _endasm 0008 EF2F GOTO 0x5e 000A F000 NOP 62: } 000C 0012 RETURN 0 63: #pragma code 64: 65: #pragma interrupt high_isr 66: void high_isr (void) 005E CFDA MOVFF 0xfda, 0xfe4 0060 FFE4 NOP 0062 CFE2 MOVFF 0xfe2, 0xfda 0064 FFDA NOP 0066 CFE9 MOVFF 0xfe9, 0xfe4 0068 FFE4 NOP 006A CFEA MOVFF 0xfea, 0xfe4 006C FFE4 NOP 006E 52E6 MOVF 0xfe6, F, ACCESS 0070 CFD9 MOVFF 0xfd9, 0xfe6 0072 FFE6 NOP 0074 CFE1 MOVFF 0xfe1, 0xfd9 0076 FFD9 NOP 0078 0E02 MOVLW 0x2 007A 26E1 ADDWF 0xfe1, F, ACCESS 67: { 68: 69: uint8 temp; 70: uint8 tempSSPSTAT; 71: 72: if(INTCONbits.TMR0IF == 1)//定时10ms 007C A4F2 BTFSS 0xff2, 0x2, ACCESS 007E D011 BRA 0xa2 73: { 74: 75: bShowLED = 1; 0080 0100 MOVLB 0 0082 0E01 MOVLW 0x1 0084 6F96 MOVWF 0x96, BANKED 76: /*if(bShowLED != 1) 77: { 78: if(ShowLEDTimer0 < 1) 79: ShowLEDTimer0++; 80: else 81: { 82: ShowLEDTimer0 = 0; 83: bShowLED = 1; 84: } 85: }*/ 86: 87: if(bKeyDelay) 0086 519B MOVF 0x9b, W, BANKED 0088 E007 BZ 0x98 88: { 89: if(KeyDelayTimer0 < 1) 008A 0E01 MOVLW 0x1 008C 5D9D SUBWF 0x9d, W, BANKED 008E E202 BC 0x94 90: KeyDelayTimer0++; 0090 2B9D INCF 0x9d, F, BANKED 91: else 0092 D002 BRA 0x98 92: { 93: bKeyDelay = 0; 0094 6B9B CLRF 0x9b, BANKED 94: KeyDelayTimer0 = 0; 0096 6B9D CLRF 0x9d, BANKED 95: } 96: } 97: 98: TMR0H = 0xE5; 0098 0EE5 MOVLW 0xe5 009A 6ED7 MOVWF 0xfd7, ACCESS 99: TMR0L = 0x01; 009C 0E01 MOVLW 0x1 009E 6ED6 MOVWF 0xfd6, ACCESS 100: 101: INTCONbits.TMR0IF = 0; 00A0 94F2 BCF 0xff2, 0x2, ACCESS 102: } |