Need waitpeq examples

Looking for good example of waitpeq or waitpne instruction. Has anyone posted an object using these in OBEX?
The daSilva tutorial has example, but it is using immediate values, and does not help me on the higher pins. Need a bit better explanation than the Prop man provides.
Thanks,
Frank
The daSilva tutorial has example, but it is using immediate values, and does not help me on the higher pins. Need a bit better explanation than the Prop man provides.
Thanks,
Frank
Comments
The instruction continuously reads the ina register (pin state) and ANDs it with the mask value, then compares to the state value. The cog halts until the result of the AND matches the state value.
This means that only pins with a bit set in the mask value are inspected, and each must match the relevant bits in the state.
It's not the purpose of the OBEX to have examples of instruction use. It's a repository of library objects, hopefully of general use for specific functions or I/O devices. Most of the I/O drivers that have assembly routines make use of WAITPxx instructions.
@Mark_T
Thanks for your reply, that is about what I was looking for. Looks like what I had but mine would just not work. The code posted may help me to determine just why what I wrote is not doing what I think it is.
@ Mike.
I perhaps may have misled you in what I was needing. What I meant to say was looking for an example using register content rather than immediate. I do understand the immediate vs.content of address. not in question actually. What I was looking for was how someone else wrote theirs so that I could compare with the way I did mine (and did not work).
As to the OBEX, while it is not a repository of "examples", the very existence of the objects makes them examples. Few objects on the OBEX that I have looked at for use have met my needs as is. I have never expected them to. No reasonable person would. However, there are many very good, actually some "best practices" and ideas that one can look at learn from and emulate while folding them to the needed use. I reviewed many objects to create a three wire LCD driver in spin. Partly to see if I could teach myself to write one, and to use minimal I/O pins. I got to three, because I need be very miserly in one project coming up; 32 pins may be a bit to tight. Someone mentioned that they actually got to one line. The statement regarding the waitpxx instructions being fairly well represented in the I/O devices was part of what I was looking for.
Frank
Here is the solution, resolution prompted by Mark_T (and a host of others).
and the resulting timing
Thanks to all on this one.
Frank
Thought about this. May revisit.
Thanks,
Frank
> muxz outa,pcsel ' set output to low
As stated by Mr K,
You only use muxz if your previous line(s) of code used a instruction that set z (conditionally 0 or a 1) and
that you now want to set the destination registers bits to having the same value as z.
Mask will take care of only setting the bits you want affected,
as having a final result of only #0 or #-1 would be very limiting to its use.
So muxz it just a shortcut to avoid two lines with if_z & if_nz.
If you know the the value you want to set, use or & andn instead.