User Guide
224 Chapter 15, Bitwise Compares
Overview of Bitwise Compares
DVD players store GPRM and SPRM information in GPRM and SPRM memory registers. Each
register contains two bytes, or 16 bits. Each bit has a value of 1 (On) or 0 (Off). Taken
together, the string of bits in a GPRM or SPRM register is a binary value, such as 1001011 or
111001010110.
Scenarist can place commands on a DVD disc that instruct the DVD player to compare a
value to a GPRM or SPRM value, and use the Boolean logic AND instruction (the Bitwise
Compare operator) to return a third value. This third binary value will either be a zero value
and therefore false, or a non-zero value and therefore true. As with the other Compare
operators, once you instruct the DVD player to check whether a comparison is true, it can
either execute or skip the next command.
For example, the sixth bit in SPRM2 determines whether a subpicture is being displayed. A
value of 1 indicates the subpicture is on-screen; a value of 0 indicates the subpicture is
offscreen. You can use a Bitwise Compare to compare the value 1000000 to the SPRM value
1011011 to determine whether the subpicture is on-screen. The Bitwise Compare operator
(&) is a Boolean logic AND instruction. Each bit in the first string is compared to its opposite
bit in the second string according to the following rules:
• 0 & 0 = 0 (False)
• 0 & 1 = 0 (False)
• 1 & 0 = 0 (False)
• 1 & 1 = 1 (True)