Shop OBEX P1 Docs P2 Docs Learn Events
MAX and MIN inconsistent with P1 — Parallax Forums

MAX and MIN inconsistent with P1

P2's implementation appears to differ from P1, as the flags differ.

P1 MAX/MIN:
* Z : S=0

P2 MAX/MIN:
* Z : result=0

This change makes sense to me. Is this an intended change?

P1 MAX:
* C : D<S

P2 MAX:
* C : S<D

C for MIN is the same on P1 and P2. I suspect C for MAX on P2 is a bug.

I have not yet examined MAXS/MINS.

(rant: MAX is a bad name for this instruction. In most languages, it returns the maximum value, not the minimum value. Same goes for MIN. Maybe consider swapping MAX and MIN, then adding LMIN and LMAX as aliases for people who think in SPIN terms.)

Comments

Sign In or Register to comment.