Propeller Manual

Table Of Contents
3: Assembly Language Reference – WAITVID
WAITVID
Instruction: Pause a cog’s execution until its Video Generator is available to take pixel data.
WAITVID Colors, # Pixels
Colors (d-field) is the register with four byte-sized color values, each describing the
four possible colors of the pixel patterns in Pixels.
Pixels (s-field) is the register or a 9-bit literal whose value is the next 16-pixel by 2-bit
(or 32-pixel by 1-bit) pixel pattern to display.
Opcode Table:
–INSTR– ZCRI –CON– –DEST– –SRC– Z Result C Result Result Clocks
111111 000i 1111 ddddddddd sssssssss
D + S = 0 Unsigned overflow Not Written 5+
Concise Truth Table:
In Out
Destination Source Z
C
Effects
Destination
1
Z C
$0000_0002; 2 $FFFF_FFFD; -3 -
-
wr wz wc
$FFFF_FFFF; -1 0 0
$0000_0002; 2 $FFFF_FFFE; -2 -
-
wr wz wc
$0000_0000; 0 1 1
$0000_0002; 2 $FFFF_FFFF; -1 -
-
wr wz wc
$0000_0001; 1 0 1
$0000_0002; 2 $0000_0000; 0 -
-
wr wz wc
$0000_0002; 2 0 0
1
Destination is not written unless the WR effect is given.
Explanation
WAITVID, “Wait for Video Generator,” is one of four wait instructions (WAITCNT, WAITPEQ,
WAITPNE, and WAITVID) used to pause execution of a cog until a condition is met. The WAITVID
instruction pauses the cog until its Video Generator hardware is ready for the next pixel data,
then the Video Generator accepts that data (Colors and Pixels) and the cog continues
execution with the next instruction. The
WAITVID instruction behaves similar to Spin’s
WAITVID command; see WAITVID on page 225.
If the
WZ effect is specified, the Z flag will be set (1) if the Colors and Pixels are equal.
Make sure to start the cog’s Video Generator module and Counter A before executing the
WAITVID command or it will wait forever. See VCFG on page 213, VSCL on page 216, and CTRA,
CTRB
on page 95.
Propeller Manual v1.1 · Page 371