### Mnemonic: Set

Hex Code: | 6J | 00 | 00 | RR | 00 | SS | 00 | 00 | unconditional, indirect set
6J | M0 | XX | RR | 00 | SS | 00 | YY | M=1-7, Compare register XX to register YY, indirect set
6J | M0 | XX | RR | 00 | SS | KK | KK | M=9-F, Compare register XX to constant KKKK, indirect set
6J | 0K | 00 | RR | 00 | SS | HH | LL | unconditional, indirect set, K=1,4-7 Set then Link
7J | 00 | 00 | RR | SS | SS | 00 | 00 | unconditional, direct set
7J | M0 | XX | RR | SS | SS | 00 | YY | M=1-7, Compare register XX to register YY, direct set
7J | M0 | XX | RR | SS | SS | KK | KK | M=9-F, Compare register XX to constant KKKK, direct set
7J | 0K | 00 | RR | SS | SS | HH | LL | unconditional, direct set, K=1,4-7 Set then Link

Action: | The Set command sets the destination register "RR" (byte 3) to the result of the operation "J", listed below. The indirect form uses GPRM or SPRM denoted by "SS" (byte 5) as the source, as allowed by the operation. The direct form uses the constant "SSSS" (bytes 4&5) as the source value, if allowed by the operation. If "K" is 1, 4, 5, 6, or 7 the Set is followed by a link command.
Order: | If a compare is specified, it is performed first. If the conditions are met the Set is executed.
Comments: | While this command allows the use of seperate registers and constants for set and compare, and also allows the full range of link commands, it can not combine compare and link in the same command. The related command SetCLnk (set and conditionally link) can combine compare and link, but shares a register in common with set and compare, and is limited to the link subset. Related commands CSetCLnk (conditionally set and link) and CSetLnk (conditionally set, unconditionally link) can combine compare and link, do not share registers but are limited to one constant for either set or compare, and are limited to the link subset.

Set operation codes | Source may be
--- | ---
J | Mnemonics | Operation | GPRM | SPRM | constant
1 | = mov | set destination GPRM to source value |  |  |
2 | <-> swp | swap destination GPRM with source GPRM |  |  |
3 | += add | add source value to destination GPRM |  |  |
4 | -= sub | subtract source value from destination GPRM |  |  |
5 | *= mul | multiply destination GPRM by source value |  |  |
6 | /= div | divide destination GPRM by source value |  |  |
7 | %= mod | set destination GPRM to destination register modulo source value |  |  |
8 | ?= rnd | set destination GPRM to a random value between 1 and the source value |  |  |
9 | &= and | and destination GPRM with source value |  |  |
A | |= or | or destination GPRM with source value |  |  |
B | ^= xor | xor destination GPRM with source value |  |  |

Compare operation codes
register to register | register to constant | Alternate mnemonic | Comments
--- | --- | --- | ---
M | operation | M | operation
1 | RegX & RegY | 9 | RegX & K | BC | Bitwise compare, the two operands are anded, if the result is non-zero the condition is true
2 | RegX == RegY | A | RegX == K | EQ | If the two operands are equal the condition is true
3 | RegX != RegY | B | RegX != K | NE | If the two operands are not equal the condition is true
4 | RegX >= RegY | C | RegX >= K | GE | If RegX is greater than or equal to the right operand the condition is true
5 | RegX > RegY | D | RegX > K | GT | If RegX is greater than the right operand the condition is true
6 | RegX <= RegY | E | RegX <= K | LE | If RegX is less than or equal to the right operand the condition is true
7 | RegX < RegY | F | RegX < K | LT | If RegX is less than the right operand the condition is true

Optional Link Command details
K | LL | Link Command | Comment
--- | --- | --- | ---
1 | 00 | LinkNoLink | use byte 6 as "HH" in these detailed pages, ignore all other values.
1 | 01 | LinkTopCell
1 | 02 | LinkNextCell
1 | 03 | LinkPrevCell
1 | 05 | LinkTopPG
1 | 06 | LinkNextPG
1 | 07 | LinkPrevPG
1 | 09 | LinkTopPGC
1 | 0A | LinkNextPGC
1 | 0B | LinkPrevPGC
1 | 0C | LinkGoUpPGC
1 | 0D | LinkTailPGC
1 | 10 | RSM
4 | -- | LinkPGCN | use bytes 6 and 7 as "NNNN" in this detailed page, ignore all other values.
5 | -- | LinkPTTN | use bytes 6 and 7 as "HTTT" in this detailed page, ignore all other values.
6 | -- | LinkPGN | use bytes 6 and 7 as "HHPP" in this detailed page, ignore all other values.
7 | -- | LinkCN | use bytes 6 and 7 as "HHNN" in this detailed page, ignore all other values.

Register Codes
0x00 through 0x0F | General Purpose registers 0 to 15 (GPRM)
0x80 through 0x97 | System Parameter registers 0 to 23 (SPRM)
all others | do not use

Numerically | Alphabetically | Index | Alphabetically | Numerically

DVD-Video info home | Copyright © 2001 - 2020 STN Software, all rights reserved.