tmp = ~0x01; //编译及执行结果是正确的,
WDR();
if ( tmp == ~0x01) //编辑及执行结果是错误的,看下面汇编,为什么比较的时候不支持“~”呢?有那位可以讲解一下,谢谢!
{
WDR();
}
WDR();
main.c:44 WDR();
0x8fe0 <main+4> 0x35AA50E0 MOV 0x50e0,#0xaa MOV _IWDG_KR,#0xaa
main.c:46 tmp = ~0x01;
0x8fe4 <main+8> 0xA6FE LD A,#0xfe LD A,#0xfe
0x8fe6 <main+10> 0x6B01 LD (0x01,SP),A LD (0x01,SP),A
main.c:47 WDR();
0x8fe8 <main+12> 0x35AA50E0 MOV 0x50e0,#0xaa MOV _IWDG_KR,#0xaa
main.c:49 if ( tmp == ~0x01)
0x8fec <main+16> 0x7B01 LD A,(0x01,SP) LD A,(0x01,SP)
main.c:54 WDR();
0x8fee <main+18> 0x35AA50E0 MOV 0x50e0,#0xaa MOV _IWDG_KR,#0xaa |