Could you tell me what mean .Reg & ~0x10 in calculation

Post and discuss new components that you have created.
Post Reply
Xbiotec
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

Flowcode v10 Could you tell me what mean .Reg & ~0x10 in calculation

Post by Xbiotec »

hi
could you tell me what mean (.Reg & ~0x10) in calculation ?
especialy the "~"
thx
Seb

mnfisher
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

Post by mnfisher »

. 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

Post Reply