• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Nybble Help

If you do it twice you'll be where you started.

See the (bit)pattern?

Except in the case where you XOR it with itself... the first time will zero it, and the second will just leave it set to zero.

This is why the "swap two values without an intermediate location" trick only works if you can guarantee that the two locations holding the values are different.

:nerd :nerd :nerd
​
 
Except in the case where you XOR it with itself... the first time will zero it, and the second will just leave it set to zero.

This is why the "swap two values without an intermediate location" trick only works if you can guarantee that the two locations holding the values are different.

:nerd :nerd :nerd
​

Take the 'mask' off.
 
Take the 'mask' off.

You can't - if the source, mask and destination are all the same location (i.e. the value at that location is XORed with itself and the result stored back into that location in one atomic operation), then the mask has become zero.
 
Nybble - that was a cool mag. dedicated to Apple II. i can remember entering hex code by hand from the pages. What was hilarious is watching terminator and seeing the code scroll by.
 

Advertisers

Back
Top