Shop OBEX P1 Docs P2 Docs Learn Events
WAITPNE: a missed opportunity? — Parallax Forums

WAITPNE: a missed opportunity?

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2009-10-05 08:32 in Propeller 1
When using the waitpne d,s instruction, it's almost always necessary to know which bits caused the mismatch. One can always read ina, of course, and with s, and xor with d, but that won't always yield the correct information. The problem comes if ina changes again between the waitpne and the read of ina. Plus, if you want to reuse the same waitpne, you've got to rewrite d with the current state.

Wouldn't it have been neat if waitpne d,s wr did all that for you? d would not only be rewritten automatically, but with the actual state of ina & s that caused the waitpne to terminate, not something that gets read later. But, alas, executing waitpne d,s wr results in d += s+1! I'm not sure if this was an accident, an oversight, or a "running out of silicon" problem. Perhaps the more useful behavior will be included in the Prop II.

-Phil

Comments

Sign In or Register to comment.