SPLat Logo

WaitOnK ii+

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

WaitOnK ii+

PC = (input ii positive edge) ? (PC + 1) : (PC)

Normal SPLat inputs are capable of latching an OFF to ON transition. This is handy for such things as reading input button presses. The WaitOnK ii instruction will stall until a transition is registered on input ii. This could be a transition that was captured and stored before the instruction is executed. If there is no such prior transition, the instruction will wait indefinitely for a new transition. In a MultiTrack task this is not a problem.

Executing the WaitOnK instruction clears the latched transition, so a new OFF to ON transition would be required for a second WaitOnK to respond.

+ From dialect 16 the address argument will be jndexed when executed inside a MultiTrack task and will be indexed if the instruction is preceded by the IasJ: precode.

Dialect exclusions: Not available in dialects before 9.

See also ResetK InputK WaitOn WaitOnT WaitOff WaitOffT WaitOnKT KBeepOn, KBeepOff GoIfInK