hi
could you tell me what mean (.Reg & ~0x10) in calculation ?
especialy the "~"
thx
Could you tell me what mean .Reg & ~0x10 in calculation
-
- Posts: 200
- http://meble-kuchenne.info.pl
- Joined: Thu Sep 23, 2021 3:44 pm
- Location: France
- Has thanked: 32 times
- Been thanked: 24 times
-
- Valued Contributor
- Posts: 1224
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 119 times
- Been thanked: 628 times
Re: Could you tell me what mean .Reg & ~0x10 in calculation
. Reg is a local variable.
~ is a bit wise 'not' (0 bits go to 1 and 1 to 0)
So this is often used for clearing a bit or bits in a variable or register - & (And) returns a result where there is a 1bit only if it is 1 in both arguments.
Martin
~ is a bit wise 'not' (0 bits go to 1 and 1 to 0)
So this is often used for clearing a bit or bits in a variable or register - & (And) returns a result where there is a 1bit only if it is 1 in both arguments.
Martin