Operation types – Apple DVD Studio Pro 4 User Manual
Page 495
4
Choose the GPRM target from the Target pop-up menu.
Operation Types
There are 11 operations you can choose from to control how the source and target values
are handled. There are limitations you need to keep in mind when using these operations:
• Registers have no overflow or underflow flags.
• If the script tries to store a value smaller than 0 or larger than 65535, no error message
is given; instead, the value “wraps around.” For example, if you subtract 7 from 3, you
would normally get –4. But if you do this in a script, 65532 is stored. If you add 6 to
65534 in a script, 4 is stored instead of 65540.
The operation types are:
• mov: Moves the source value to the target location, overwriting the existing value in
the target.
• swp: Swaps the source value with the target value. The source value is written to the
target location, and the target value is written to the source location. This is the only
operation that writes to the source location.
• add: Adds the source and target values together and writes the result in the target
location.
• sub: Subtracts the source value from the target value and writes the result in the target
location.
• mul: Multiplies the source value by the target value and writes the result in the target
location.
• div: Divides the target value by the source value and writes the result in the target
location.
• mod: Divides the target value by the source value and writes the remainder (modulo)
in the target location.
• ran: Generates a random value between 1 and the source value and writes the result
in the target location.
495
Chapter 20
Creating Scripts