I stumbled onto a little issue today that had me scratching my head for a while.
It appears to be a pipeline/data forwarding issue with the flags and PTRx register.
I went back to V26 and it has the same symptoms as V28 so it's not a new thing.
In the following code the testb instruction tests the bit ok and sets the C flag as expected.
But this seems to zero the original PTRx value.
The subsequent shr fails.
If I then comment out the testb instruction the shr works fine as expected.
On the othere hand if I place a nop before the testb instruction it fails too.
I'm guessing it could also be a shadow ram conflict as the PTRx registers have
a indexing mechanism as well.
I I substitute PTRx with any othere register it all works Ok.
Am I breaking the rules again? Sorry to be a pain.
bmask dirb,#15 'enable leds
testb ptra,#24 wc
shr ptra,#24 wz
outnz #40 'show c and z results on leds
waitx ##80_000_000 'wait a while then show result