Operands that are smaller than an int (such as bool and char ) are converted to int before the operator is applied.
这句话或许是正解。
不过感觉这东东还是不自然,在同一类型unsigned char的两个数 之间操作理论上是不要提升。或许这就是传说中的规矩和潜规则?
对我有用[0]丢个板砖[0]引用举报管理TOP
KEI为b2 =~b2;产生的汇编代码有三条:
1、将b1拷贝到位寄存器”C"中
2、CPL C 即对位寄存器按位取反并将结果存于C
3、将C中的值赋给b2
而对于CPL按位取反指令,手册上有这样的解释:Description: CPL complements operand, leaving the result in operand. If operand is a single bit then the state of the bit will be reversed.