p0_1=p0_1^0x01是什么意思?while(1) { clock(RunSpeed); P0_1=P0_1^0x01; }

问题描述:

p0_1=p0_1^0x01是什么意思?
while(1)
{
clock(RunSpeed);
P0_1=P0_1^0x01;
}

C语言

^为异或运算符,也称XOR运算符.它的规则是若参加运算的两个二进位同号,则结果为0(假);异号则为1(真).
等式右边是将P0_1的数据与0x01相异或,再将结果赋给P0_1.