Robert Newson writes:

> I must admit I'm a bit confused by your table, along with the fact that it
> nowhere deals with the V (oVerflow) flag - important with signed

It was only intended as a simplified overview of those branches that I find
myself frequently inverting. It seemed to answer the problem expressed by
Jerome. Perhaps my table is too simplistic? For the values shown, the flags
should all be correct (Ive just re-checked to make sure.) For anything more
complicated I seem to be able to cope better, or I just look it up in my
book ;)

> comparisons; eg as CMP is effectively SUB without setting the result,
using
> 8 bits:
>
>              -127 - +2 = +127
>
> so should this branch be taken:
>
>               MOVE.B #-127,D2
>               MOVE.B #2,D1
>               CMP.B D1,D2
>               BMI.S d1_less
>
> Looking at the 1/-1 column (closest, as I've got 2/-127), I see that N is
> set and so branch should be taken.  However, N is in fact clear - N,Z are

Oops! We'll have to get Jmon and C1mon fixed then, 'cause they both show the
N flag excactly as in my table ;) However, for the values in your example V
is set and NCZ are clear.

<>
> Extending your table to include V settings is a bit awkward (homework).  I
> use the following table:

No need for the homework: I like your table and will adopt it forthwith! I
particularly liked the compressed logical expressions for the flags.

Per





Reply via email to