### Virtual Machine Instruction Set - broken down by value

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | <- Byte
7-5 | 4 | 3-0 | 7 | 6-4 | 3-0 | 7-4 | 3-0 | 7-0 | 7-0 | 7-0 | 7-4 | 3-2 | 1-0 | 7-0 | <- Bits
Type | Direct | SET | Dir Cmp | CMP | CMD | operand 1 | operand 2 | operand 3 | Mnemonic | Operands
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
0 |  |  | X | 0 | 0 |  |  |  | NOP |
0 |  |  | X | 0 | 1 |  |  |  | line# | Goto | line#
0 |  |  | X | 0 | 2 |  |  |  | Break |
0 |  |  | X | 0 | 3 |  |  | 0 | lvl | line# | SetTmpPML | lvl, line#
0 |  |  | 0 | 1-7 | 0-3 |  | cr1* |  | cr2* | as above | Cplus above | reg(cr1) cmp-op reg(cr2) plus above
0 |  |  | 1 | 1-7 | 0-3 |  | cr1* | cval | as above | Cplus above | reg(cr1) cmp-op #cval plus above
0 | X | X | X | X | 4-F | X | X | X | invalid |
1 | 0 |  | X | 0 | 0 |  |  |  | NOP |
1 | 0 |  | X | 0 | 1 |  |  | Link subset | Link subset |
1 | 0 |  | X | 0 | 4 |  |  | pgcn | LinkPGCN | pgcn
1 | 0 |  | X | 0 | 5 |  |  | hl_bn | pttn | LinkPTTN | pttn [,button=hl_bn]
1 | 0 |  | X | 0 | 6 |  |  | hl_bn | 0 | pgn | LinkPGN | pgn [,button=hl_bn]
1 | 0 |  | X | 0 | 7 |  |  | hl_bn | 0 | cn | LinkCN | cn [,button=hl_bn]
1 | 0 |  | 0 | 1-7 | 0, 1, 4-7 |  | cr1* |  | cr2* | as above | Cplus above | reg(cr1) cmp-op reg(cr2) plus above
1 | 0 |  | 1 | 1-7 | 0, 1, 4-7 |  | cr1* | cval | as above | Cplus above | reg(cr1) cmp-op #cval plus above
1 | 0 | X | X | X | 2, 3, 8-F | X | X | X | invalid |
1 | 1 |  | X | 0 | 0 |  |  |  | NOP |
1 | 1 |  | X | 0 | 1 |  |  |  | Exit |
1 | 1 |  | X | 0 | 2 |  |  | ttn |  | JumpTT | ttn
1 | 1 |  | X | 0 | 3 |  |  | ttn |  | JumpVTS_TT | ttn
1 | 1 |  | X | 0 | 5 |  | pttn |  | ttn |  | JumpVTS_PTT | ttn pttn
1 | 1 |  | X | 0 | 6 |  |  | 0 |  |  | JumpSS | FP
1 | 1 |  | X | 0 | 6 |  |  | 1 |  | menu |  | JumpSS | VMGM menu
1 | 1 |  | X | 0 | 6 |  | ttn | vts | 2 |  | menu |  | JumpSS | VTSM vts, ttn, menu
1 | 1 |  | X | 0 | 6 | pgcn |  | 3 |  |  | JumpSS | VMGM pgcn
1 | 1 |  | X | 0 | 8 |  | rsm_cell | 0 |  |  | CallSS | FP [rsm_cell]
1 | 1 |  | X | 0 | 8 |  | rsm_cell | 1 |  | menu |  | CallSS | VMGM menu [, rsm_cell]
1 | 1 |  | X | 0 | 8 |  | rsm_cell | 2 |  | menu |  | CallSS | VTSM menu [, rsm_cell]
1 | 1 |  | X | 0 | 8 | pgcn | rsm_cell | 3 |  |  | CallSS | VMGM pgcn [, rsm_cell]
1 | 1 |  |  | 1-7 | 0-3, 5, 6, 8 | as above | as above | cr1* | cr2* | Cplus above | reg(cr1) cmp-op reg(cr2) plus above
1 | 1 | X | X | X | 4, 7, 9-F | X | X | X | invalid |
2 | X | 0 | X | 0 | 0 |  |  |  | NOP |
2 | 0 | 1 | X | 0 | 0 |  | af |  | sr1 | sf |  | sr2 | nf |  | sr3 |  | SetSTN | if(af) Audio = Gsr1 if(sf) Subpicture = Gsr2 if(nf) Angle = Gsr3
2 | 0 | 2 | X | 0 | 0 |  | srs | pgcn |  | SetNVTMR | Gsrs, pgcn
2 | 0 | 3 | X | 0 | 0 |  | srs |  | mf |  | srd |  | SetGPRMMD | Gsrd = Gsrs [,COUNTER](mf=1)
2 | 0 | 4 | X | 0 | 0 |  |  | srs |  | SetAMXMD | Gsrs
2 | 0 | 6 | X | 0 | 0 |  |  | srs |  | SetHL_BTNN | Gsrs
2 | 1 | 1 | X | 0 | 0 |  | af | aval | sf | sval | nf | nval |  | SetSTN | if(af) Audio = #aval if(sf) Subpicture = #sval if(nf) Angle = #nval
2 | 1 | 2 | X | 0 | 0 | sval | pgcn |  | SetNVTMR | #sval, pgcn
2 | 1 | 3 | X | 0 | 0 | sval |  | mf |  | srd |  | SetGPRMMD | Gsrd = #sval [,COUNTER](mf=1)
2 | 1 | 4 | X | 0 | 0 |  | sval |  | SetAMXMD | #sval
2 | 1 | 6 | X | 0 | 0 |  | sval |  | SetHL_BTNN | #sval
2 | as above | as above |  | 1-7 | 0 | as above | as above | cr1* | cr2* | Cplus above | reg(cr1) cmp-op reg(cr2) plus above
2 | as above | as above | X | 0 | 1, 4-7 | as above | as above | as per link | as above // as per link | as above // as per link
2 | X | 7-F | X | X | X | X | X | X | invalid SetSystem
2 | X | X | X | 0 | 2, 3, 8-F | X | X | X | invalid Link
2 | X | X | X | 1-7 | 1-F | X | X | X | illegal - CMP & LNK conflict
3 | X | 0 | X | 0 | 0 |  |  |  | NOP |
3 | 0 | 1-B | X | 0 | 0 |  | srd |  | srs* |  | Set | Gsrd set-op reg(srs)
3 | 1 | 1-B | X | 0 | 0 |  | srd | sval |  | Set | Gsrd set-op #sval
3 | as above | as above | 0 | 1-7 | 0 | cr1* | as above | as above |  | cr2* | Cplus above | reg(cr1) cmp-op reg(cr2), plus above
3 | as above | as above | 1 | 1-7 | 0 | cr1* | as above | as above | cval | Cplus above | reg(cr1) cmp-op #cval, plus above
3 | as above | as above | X | 0 | 1, 4-7 | as above | as above | as per link | as above // as per link | as above // as per link
3 | X | C-F | X | X | X | X | X | X | invalid Set
3 | X | X | X | 0 | 2, 3, 8-F | X | X | X | invalid Link
3 | X | X | X | 1-7 | 1-F | X | X | X | illegal - CMP & LNK conflict
4 | X | 0 | X | 0 | X |  |  | X |  | 00 | NOP |
4 | 0 | 1-B | X | 0 | srd |  | srs* |  | X |  | 00 | Set | Gsrd set-op reg(srs)
4 | 1 | 1-B | X | 0 | srd | sval |  | X |  | 00 | Set | Gsrd set-op #sval
4 | X | 0 | X | 0 |  |  |  | hl_bn |  | 01-1F | Lnk | [button=hl_bn]
4 | 0 | 1-B | X | 0 | srd |  | srs* |  | hl_bn |  | 01-1F | SetLnk | Gsrd set-op reg(srs) [, button=hl_bn]
4 | 1 | 1-B | X | 0 | srd | sval |  | hl_bn |  | 01-1F | SetLnk | Gsrd set-op #sval [, button=hl_bn]
4 | X | 0 | 0 | 1-7 | cr1 |  |  | cr2* | hl_bn |  | 01-1F | CmpLnk | Gcr1 cmp-op reg(cr2) [, button=hl_bn]
4 | X | 0 | 1 | 1-7 | cr1 |  | cval | hl_bn |  | 01-1F | CmpLnk | Gcr1 cmp-op #cval [, button=hl_bn]
4 | 0 | 1-B | 0 | 1-7 | srd |  | srs* |  | cr2* | hl_bn |  | 01-1F | SetCLnk | Gsrd set-op reg(srs), Gsrd cmp-op reg(cr2) [, button=hl_bn]
4 | 0 | 1-B | 1 | 1-7 | srd |  | srs* | cval | hl_bn |  | 01-1F | SetCLnk | Gsrd set-op reg(srs), Gsrd cmp-op #cval [, button=hl_bn]
4 | 1 | 1-B | 0 | 1-7 | srd | sval |  | cr2* | hl_bn |  | 01-1F | SetCLnk | Gsrd set-op #sval, Gsrd cmp-op reg(cr2) [, button=hl_bn]
4 | 1 | 1-B | 1 | 1-7 | srd | sval | cval | hl_bn |  | 01-1F | SetCLnk | Gsrd set-op #sval, Gsrd cmp-op #cval [, button=hl_bn]
5, 6 | X | 0 | X | 0 | X |  |  | X |  | 00 | NOP |
5, 6 | 0 | 1-B | X | 0 | srd | srs* |  |  | X |  | 00 | Set | Gsrd set-op reg(srs)
5, 6 | 1 | 1-B | X | 0 | srd | sval |  | X |  | 00 | Set | Gsrd set-op #sval
5, 6 | X | 0 | X | 0 |  |  |  | hl_bn |  | 01-1F | Lnk | [button=hl_bn]
5, 6 | 0 | 1-B | X | 0 | srd | srs* |  |  | hl_bn |  | 01-1F | SetLnk | Gsrd set-op reg(srs) [, button=hl_bn]
5, 6 | 1 | 1-B | X | 0 | srd | sval |  | hl_bn |  | 01-1F | SetLnk | Gsrd set-op #sval [, button=hl_bn]
5, 6 | 0 | 0 | 0 | 1-7 |  |  | cr1* |  | cr2* | hl_bn |  | 01-1F | CmpLnk | reg(cr1) cmp-op reg(cr2) [, button=hl_bn]
5, 6 | 0 | 0 | 1 | 1-7 |  |  | cr1* | cval | hl_bn |  | 01-1F | CmpLnk | reg(cr1) cmp-op #cval [, button=hl_bn]
5, 6 | 1 | 0 | X | 1-7 |  |  | cr1* | cr2* | hl_bn |  | 01-1F | CmpLnk | reg(cr1) cmp-op reg(cr2) [, button=hl_bn]
5, 6 | 0 | 1-B | 0 | 1-7 | srd | srs* | cr1* |  | cr2* | X |  | 00 | CmpSet | reg(cr1) cmp-op reg(cr2), Gsrd set-op reg(srs)
5, 6 | 0 | 1-B | 1 | 1-7 | srd | srs* | cr1* | cval | X |  | 00 | CmpSet | reg(cr1) cmp-op #cval, Gsrd set-op reg(srs)
5, 6 | 1 | 1-B | X | 1-7 | srd | sval | cr1* | cr2* | X |  | 00 | CmpSet | reg(cr1) cmp-op reg(cr2), Gsrd set-op #sval
5 | 0 | 1-B | 0 | 1-7 | srd | srs* | cr1* |  | cr2* | hl_bn |  | 01-1F | CSetCLnk | reg(cr1) cmp-op reg(cr2), Gsrd set-op reg(srs) [, button=hl_bn]
5 | 0 | 1-B | 1 | 1-7 | srd | srs* | cr1* | cval | hl_bn |  | 01-1F | CSetCLnk | reg(cr1) cmp-op #cval, Gsrd set-op reg(srs) [, button=hl_bn]
5 | 1 | 1-B | X | 1-7 | srd | sval | cr1* | cr2* | hl_bn |  | 01-1F | CSetCLnk | reg(cr1) cmp-op reg(cr2), Gsrd set-op #sval [, button=hl_bn]
6 | 0 | 1-B | 0 | 1-7 | srd | srs* | cr1* |  | cr2* | hl_bn |  | 01-1F | CmpSetLnk | reg(cr1) cmp-op reg(cr2), Gsrd set-op reg(srs) [, button=hl_bn]
6 | 0 | 1-B | 1 | 1-7 | srd | srs* | cr1* | cval | hl_bn |  | 01-1F | CmpSetLnk | reg(cr1) cmp-op #cval, Gsrd set-op reg(srs) [, button=hl_bn]
6 | 1 | 1-B | X | 1-7 | srd | sval | cr1* | cr2* | hl_bn |  | 01-1F | CmpSetLnk | reg(cr1) cmp-op reg(cr2), Gsrd set-op #sval [, button=hl_bn]
4, 5, 6 | X | C-F | X | X | X | X | X | X | invalid Set
7 |  |  |  |  |  | unknown |

* register values 0-15 (0x00 - 0x0f) refer to General Purpose registers (GPRM), 16-127 (0x10 - 0x7f) are invalid, 128-151 (0x80 - 0x97) refer to System Parameter registers (SPRM), 152-255 (0x98 - 0xff) are invalid.

#### SET and CMP operations

Code | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
SET op | none | mov = | swp <-> | add += | sub -= | mul *= | div /= | mod %= | rnd | and &= | or |= | xor ^=
CMP op | none | BC & | EQ == | NE != | GE >= | GT > | LE <= | LT < |

#### Link subset codes

6 | 7 | <- Byte
7-2 | 1-0 | 7-5 | 4-0 | <- Bits
operand 3 | Mnemonic | Operands
--- | --- | ---
hl_bn |  | 00 | LinkNoLink | [button=hl_bn]
hl_bn |  | 01 | LinkTopCell | [button=hl_bn]
hl_bn |  | 02 | LinkNextCell | [button=hl_bn]
hl_bn |  | 03 | LinkPrevCell | [button=hl_bn]
hl_bn |  | 05 | LinkTopPG | [button=hl_bn]
hl_bn |  | 06 | LinkNextPG | [button=hl_bn]
hl_bn |  | 07 | LinkPrevPG | [button=hl_bn]
hl_bn |  | 09 | LinkTopPGC | [button=hl_bn]
hl_bn |  | 0a | LinkNextPGC | [button=hl_bn]
hl_bn |  | 0b | LinkPrevPGC | [button=hl_bn]
hl_bn |  | 0c | LinkGoupPGC | [button=hl_bn]
hl_bn |  | 0d | LinkTailPGC | [button=hl_bn]
hl_bn |  | 10 | RSM | [button=hl_bn]
X | X | 04, 08, 0E, 0F, 11-1F | invalid |

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