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

Post and discuss new components that you have created.
Post Reply
lucibel
Posts: 172
http://meble-kuchenne.info.pl
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 29 times
Been thanked: 22 times

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

Post by lucibel »

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

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 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