[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Firebee Coldfire MiNT Kernel and NFS



On 05/09/2014 10:29, Andreas Schwab wrote:
Vincent Rivière <vincent.riviere@freesbee.fr> writes:

In our case, the next instruction is BEQ, which means that only the Z flag
is important. And fortunately, that one is set identically by both
instructions.

No, it isn't.

Could you please elaborate?

From the documentation posted by Thomas:

TAS:
Z - Set if the operand was zero; cleared otherwise.

BSET:
Z - Set if the bit tested is zero; cleared otherwise.

Humm... it seems you are right.
Both TAS and BSET #7 sets the bit 7.

But the Z flag is different:
- with TAS, it reflects the previous status of the whole byte
- with BSET, it reflects only the previous status of the bit 7

So care must be taken when choosing the right bit for BSET, and check the whole logic of the routine.

Thanks for the hint.

--
Vincent Rivière