Help with Operators in Spin
Chris Merck
Posts: 55
To the best of my knowledge the following lines of spin should be equivalent (where f is a long and a and b are constants in the range 0..31):
However, these two lines give different behavior.
The interpretation here is that a and b are the names of bits in the flag register f, and the if-block is to be executed if both flags a and b are set.
Something must be wrong with how I am thinking about these operators. Can anyone clarify this?
Thanks,
Chris
if f&|<a AND f&|<b ...
if f&(|<a | |<b) ...
However, these two lines give different behavior.
The interpretation here is that a and b are the names of bits in the flag register f, and the if-block is to be executed if both flags a and b are set.
Something must be wrong with how I am thinking about these operators. Can anyone clarify this?
Thanks,
Chris
Comments
Thanks for the fast response. You are totally right. I can't believe I missed that. (This has been bugging me for 2 hours).
··...
Please correct me if I am wrong.
Sincerely,
Venkata.