home .. forth .. colorforth mail list archive ..

[ColorForth] Equality - Thanks


Thanks everyone,

A mapping function will be the way to go.

dup 5 ? if 5thing ; then  -- doesn't work because it effectively does an AND
to find the
result.
dup 5 xor -if 5thing ; then  -- doesn't work because '-if' jumps to the next
'then' if the result is not negative, 0 is not negative ...

I suggested that defining eq as
: eq xor - drop ;
doesn't work because - (NOT) doesn't affect the pentium flags. That's not
the only problem. It turns out that it doesn't work when one does update the
flags (by using -1 xor) either. I was thinking logical NOT, not binary NOT.
So much for that plan.

So once again thanks anyone.

Oh. Something I just noticed, Negate the two compliment negation word, is
defined in the forth dictionary as
: negate - 1 + ;
However the pentium has a NEG instruction, so I'm pretty sure the macro
: neg 0xd8f7 2, ;
would give the same result and be faster. Maybe I've missed somthing, but
maybe not, then it would be good to save those processor cycles. ( for a
rainy day? )

Richard Collins
------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com