C语言: [Key1_On是定义在内部RAM中的位变量] if(Key1_On==0) {} if(Key1_On==1) {}
编译后的汇编: 140: if(Key1_On==0) 0x0000001D: BTS0 0x20.2 0x0000001E: JMP 0x001F 141: {} 142: if(Key1_On==1) ;下面一大堆代码怎么来的? 0x0000001F: MOV A, 0x20 0x00000020: B0MOV 0x07, A 0x00000021: RRCM 0x07 0x00000022: RRCM 0x07 0x00000023: MOV A, #3fh 0x00000024: AND 0x07, A 0x00000025: B0MOV A, 0x07 0x00000026: AND A, #01h 0x00000027: SUB A, #01h 0x00000028: B0BTS1 PFLAG.0 0x00000029: JMP 0x002A 143: {}
C语言改成: if(Key1_On==0) { if(Key1_On) {}
编译后的汇编: 140: if(Key1_On==0) 0x0000001D: BTS0 0x20.2 0x0000001E: JMP 0x001F 141: {} 142: if(Key1_On) 0x0000001F: BTS1 0x20.2 0x00000020: JMP 0x0021 143: {} =============================================
为什么会这样?? |