標(biāo)題:
按位操作
[打印本頁]
作者:
heise
時(shí)間:
2014-8-19 22:59
標(biāo)題:
按位操作
例子:對bit3操作 a是8位00000000
1.清零 位與
a=a&(~(1<<3)) 00001000->11110111
2.置1 位或
a=a|(1<<3) 00001000
對寄存器按位操作好處:
不影響其他位的值
對目標(biāo)位進(jìn)行位操作
1先把相應(yīng)位清零
2進(jìn)行置1置零操作。
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1