37: Delay(114400); //延时
C:0x0222 7FE0 MOV R7,#ACC(0xE0)
C:0x0224 7EBE MOV R6,#0xBE
C:0x0226 7D01 MOV R5,#0x01
C:0x0228 7C00 MOV R4,#0x00
C:0x022A 120180 LCALL Delay(C:0180)
3: void Delay(long i) //延时函数Delay( )
C:0x0180 8F1E MOV 0x1E,R7
C:0x0182 8E1D MOV 0x1D,R6
C:0x0184 8D1C MOV 0x1C,R5
C:0x0186 8C1B MOV 0x1B,R4
4: {
5: unsigned int j;
6: for(;i > 0;i--)
C:0x0188 E4 CLR A
C:0x0189 FF MOV R7,A
C:0x018A FE MOV R6,A
C:0x018B FD MOV R5,A
C:0x018C FC MOV R4,A
C:0x018D AB1E MOV R3,0x1E
C:0x018F AA1D MOV R2,0x1D
C:0x0191 A91C MOV R1,0x1C
C:0x0193 A81B MOV R0,0x1B
C:0x0195 D3 SETB C
C:0x0196 12010C LCALL C?SLCMP(C:010C)
C:0x0199 4028 JC C:01C3
7: for(j=0;j<125;j++)
C:0x019B E4 CLR A
C:0x019C FF MOV R7,A
C:0x019D FE MOV R6,A
8: {;} //空函数
C:0x019E 0F INC R7
C:0x019F BF0001 CJNE R7,#0x00,C:01A3
C:0x01A2 0E INC R6
C:0x01A3 EF MOV A,R7
C:0x01A4 647D XRL A,#0x7D
C:0x01A6 4E ORL A,R6
C:0x01A7 70F5 JNZ C:019E
C:0x01A9 74FF MOV A,#0xFF
C:0x01AB 251E ADD A,0x1E
C:0x01AD F51E MOV 0x1E,A
C:0x01AF E51D MOV A,0x1D
C:0x01B1 34FF ADDC A,#0xFF
C:0x01B3 F51D MOV 0x1D,A
C:0x01B5 E51C MOV A,0x1C
C:0x01B7 34FF ADDC A,#0xFF
C:0x01B9 F51C MOV 0x1C,A
C:0x01BB E51B MOV A,0x1B
C:0x01BD 34FF ADDC A,#0xFF
C:0x01BF F51B MOV 0x1B,A
C:0x01C1 80C5 SJMP C:0188
9: }
C:0x01C3 22 RET
42: void int1_isr (void) interrupt 2 //外中断1中断函数
43: {
44: uchar m;
C:0x0122 C0E0 PUSH ACC(0xE0)
C:0x0124 C0F0 PUSH B(0xF0)
C:0x0126 C083 PUSH DPH(0x83)
C:0x0128 C082 PUSH DPL(0x82)
C:0x012A C0D0 PUSH PSW(0xD0)
C:0x012C 75D000 MOV PSW(0xD0),#0x00
C:0x012F C000 PUSH 0x00
C:0x0131 C001 PUSH 0x01
C:0x0133 C002 PUSH 0x02
C:0x0135 C003 PUSH 0x03
C:0x0137 C004 PUSH 0x04
C:0x0139 C005 PUSH 0x05
C:0x013B C006 PUSH 0x06
C:0x013D C007 PUSH 0x07
45: for(m=0;m<5;m++) //8位LED全亮全灭5次
C:0x013F 750C00 MOV 0x0C,#0x00
C:0x0142 C3 CLR C
C:0x0143 E50C MOV A,0x0C
C:0x0145 9405 SUBB A,#0x05
C:0x0147 7480 MOV A,#P0(0x80)
C:0x0149 9480 SUBB A,#P0(0x80)
C:0x014B 5010 JNC C:015D
46: {
47: P1=0; //8位LED全亮
C:0x014D 759000 MOV P1(0x90),#0x00
48: Delay(500); //延时
C:0x0150 120178 LCALL L?0023(C:0178)
49: P1=0xff; //8位LED全灭
C:0x0153 7590FF MOV P1(0x90),#0xFF
50: Delay(500); //延时
C:0x0156 120178 LCALL L?0023(C:0178)
51: }
C:0x0159 050C INC 0x0C
C:0x015B 80E5 SJMP C:0142
52: }
C:0x015D D007 POP 0x07
C:0x015F D006 POP 0x06
C:0x0161 D005 POP 0x05
C:0x0163 D004 POP 0x04
C:0x0165 D003 POP 0x03
C:0x0167 D002 POP 0x02
C:0x0169 D001 POP 0x01
C:0x016B D000 POP 0x00
C:0x016D D0D0 POP PSW(0xD0)
C:0x016F D082 POP DPL(0x82)
C:0x0171 D083 POP DPH(0x83)
C:0x0173 D0F0 POP B(0xF0)
C:0x0175 D0E0 POP ACC(0xE0)
C:0x0177 32 RETI |
@oufuqiang :你的理放之四海而皆准,你可继续按理。
@xch :别激动,这种程序一看就知道是给学生学习中断逻辑的上课内容了。 按理来说不管怎么改参数类型都应该报警告,现在我就是不能解释为什么char和int不报
主循环和几个不同中断服务函数调用了同一个函数,函数中对变量操作的指令不是原子指令。所以警告了。 你另外写几个专用的函数给各家调用即可解决。 不过这种在中断函数中嵌入软件延时的方法确实很垃圾