Trap for young (spin) players
BradC
Posts: 2,601
I've just spent an entire day chasing a bug in a bit of spin code.
val := val or $80000000
which should have been
val := val | $80000000
It was in a 32 bit shift register, and I just could not figure out why I always ended up with $FFFFFFFF
<sob sob sob>
....(goes away to read the manual a bit closer)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pull my finger!
val := val or $80000000
which should have been
val := val | $80000000
It was in a 32 bit shift register, and I just could not figure out why I always ended up with $FFFFFFFF
<sob sob sob>
....(goes away to read the manual a bit closer)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pull my finger!
Comments
-Phil
Which is precisely what I ended up with after eventually getting it working.
Now the fun part is playing with all the various constructs to minimise the size of the generated spin code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pull my finger!