我正在使用以下代码检查第 25 位的值是 0 还是 1:
volatile unsigned int * regAddr;
unsigned int regval;
regAddress = (unsigned int *) 0xD2009010; //This is a valid address of register
regVal = *regAddress; //The return value here is 0xFE008000
if (!(regVal & 0x4000000)) //For the mentioned return value, I thought the condition will be different then 0 and so used '!' to convert the value
the bit is 0;
else
the bit is 1;
此代码无法正常工作,我无法弄清楚原因。帮助任何人?提前致谢