所以語法是--set-xmark value/mask
。將得到的操作是:
ctmark = (ctmark AND NOT mask) XOR value
零出對應於(ctmark AND NOT mask)
:如果在mask
一個位被置位,則在ctmark
相應比特將是零(前XOR)。
手冊頁還指出:
--and-mark bits
Binary AND the ctmark with bits. (Mnemonic for --set-xmark
0/invbits, where invbits is the binary negation of bits.)
--or-mark bits
Binary OR the ctmark with bits. (Mnemonic for --set-xmark
bits/bits.)
--xor-mark bits
Binary XOR the ctmark with bits. (Mnemonic for --set-xmark
bits/0.)
您可以驗證上述對這些定義的操作:
--and-mark bits == --set-xmark 0/invbits
ctmark AND bits = (ctmark AND NOT invbits) XOR 0
-> bits = NOT invbits
-> anything XOR 0 = anything
so: ctmark AND bits = ctmark AND NOT NOT bits = ctmark AND bits
--or-mark bits == --set-mark bits/bits
ctmark OR bits = (ctmark AND NOT bits) XOR bits
-> should be obvious based on boolean logic
--xor-mark bits == -set-mark bits/0
ctmark XOR bits = (ctmark AND NOT 0) XOR bits
-> anything AND NOT 0 = anything
謝謝你的解釋。這對我的理解非常有幫助。 – harlan