Virtual Machine Instruction Set - broken down by value

Commands with Type 0-3 have 16 bits of Opcode and 48 bits for Parameters.
Commands with Type 4-6 have 12 bits of Opcode and 52 bits for Parameters.
Commands with Type 7 are unknown at this stage, and have never been seen in real life yet.

OpcodeParameters
01234567<- Byte
7-543-076-43-07-43-07-07-07-07-43-21-07-0<- Bits
TypeDirectSETDir CmpCMPCMDoperand 1operand 2operand 3MnemonicOperands
0  X00   NOP 
0  X01   line#Gotoline#
0  X02   Break 
0  X03  0lvlline#SetTmpPMLlvl, line#
0  01-70-3 cr1* cr2*as aboveCplus abovereg(cr1) cmp-op reg(cr2) plus above
0  11-70-3 cr1*cvalas aboveCplus abovereg(cr1) cmp-op #cval plus above
0XXXX4-FXXXinvalid 
10 X00   NOP 
10 X01  Link subsetLink subset 
10 X04  pgcnLinkPGCNpgcn
10 X05  hl_bnpttnLinkPTTNpttn [,button=hl_bn]
10 X06  hl_bn0pgnLinkPGNpgn [,button=hl_bn]
10 X07  hl_bn0cnLinkCNcn [,button=hl_bn]
10 01-70, 1, 4-7 cr1* cr2*as aboveCplus abovereg(cr1) cmp-op reg(cr2) plus above
10 11-70, 1, 4-7 cr1*cvalas aboveCplus abovereg(cr1) cmp-op #cval plus above
10XXX2, 3, 8-FXXXinvalid 
11 X00   NOP 
11 X01   Exit 
11 X02  ttn JumpTTttn
11 X03  ttn JumpVTS_TTttn
11 X05 pttn ttn JumpVTS_PTTttn pttn
11 X06  0  JumpSSFP
11 X06  1 menu JumpSSVMGM menu
11 X06 ttnvts2 menu JumpSSVTSM vts, ttn, menu
11 X06pgcn 3  JumpSSVMGM pgcn
11 X08 rsm_cell0  CallSSFP [rsm_cell]
11 X08 rsm_cell1 menu CallSSVMGM menu [, rsm_cell]
11 X08 rsm_cell2 menu CallSSVTSM menu [, rsm_cell]
11 X08pgcnrsm_cell3  CallSSVMGM pgcn [, rsm_cell]
11  1-70-3, 5, 6, 8as aboveas abovecr1*cr2*Cplus abovereg(cr1) cmp-op reg(cr2) plus above
11XXX4, 7, 9-FXXXinvalid 
2X0X00   NOP 
201X00 af sr1sf sr2nf sr3 SetSTNif(af) Audio = Gsr1
if(sf) Subpicture = Gsr2
if(nf) Angle = Gsr3
202X00 srs*pgcn SetNVTMRsrs, pgcn
203X00 srs* mf srd SetGPRMMDGsrd = srs [,COUNTER](mf=1)
204X00  srs SetAMXMDGsrs
206X00  srs SetHL_BTNNGsrs
211X00 afavalsfsvalnfnval SetSTNif(af) Audio = #aval
if(sf) Subpicture = #sval
if(nf) Angle = #nval
212X00svalpgcn SetNVTMR#sval, pgcn
213X00sval mf srd SetGPRMMDGsrd = #sval [,COUNTER](mf=1)
214X00 sval SetAMXMD#sval
216X00 sval SetHL_BTNN#sval
2as aboveas above 1-70as aboveas abovecr1*cr2*Cplus abovereg(cr1) cmp-op reg(cr2) plus above
2as aboveas aboveX01, 4-7as aboveas aboveas per linkas above // as per linkas above // as per link
2X7-FXXXXXX
invalid SetSystem
2XXX02, 3, 8-FXXX
invalid Link
2XXX1-71-FXXX
illegal - CMP & LNK conflict
3X0X00   NOP 
301-BX00 srd srs* SetGsrd set-op reg(srs)
311-BX00 srdsval SetGsrd set-op #sval
3as aboveas above01-70cr1*as aboveas above cr2*Cplus abovereg(cr1) cmp-op reg(cr2), plus above
3as aboveas above11-70cr1*as aboveas abovecvalCplus abovereg(cr1) cmp-op #cval, plus above
3as aboveas aboveX01, 4-7as aboveas aboveas per linkas above // as per linkas above // as per link
3XC-FXXXXXX
invalid Set
3XXX02, 3, 8-FXXX
invalid Link
3XXX1-71-FXXX
illegal - CMP & LNK conflict


OpcodeParameters
01234567<- Byte
7-543-076-43-07-07-07-07-07-21-07-0<- Bits
TypeSET FlagSETCMP FlagCMPoperand 1operand 2operand 3MnemonicOperands
40set-op0cmp-opscr srs* cr2*hl_bn LnkSetCLnkGscr set-op reg(srs), Gscr cmp-op reg(cr2) [, button=hl_bn]
40set-op1cmp-opscr srs*cvalhl_bn LnkSetCLnkGscr set-op reg(srs), Gscr cmp-op #cval [, button=hl_bn]
41set-op0cmp-opscrsval cr2*hl_bn LnkSetCLnkGscr set-op #sval, Gscr cmp-op reg(cr2) [, button=hl_bn]
41set-op1cmp-opscrsvalcvalhl_bn LnkSetCLnkGscr set-op #sval, Gscr cmp-op #cval [, button=hl_bn]
50set-op0cmp-opsr1sr2*cr1* cr2*hl_bn LnkCSetCLnkGscr cmp-op reg(cr2), Gscr set-op reg(srs) [, button=hl_bn]
50set-op1cmp-opsr1sr2*cr1*cvalhl_bn LnkCSetCLnkGscr cmp-op #cval, Gscr set-op reg(srs) [, button=hl_bn]
51set-op0cmp-opsr1sval2cr1cr2*hl_bn LnkCSetCLnkGscr cmp-op reg(cr2, Gscr set-op #sval [, button=hl_bn]
51X1X Illegal CSetCLnk
60set-op0cmp-opsr1sr2*cr1* cr2*hl_bn LnkCmpSetLnkGsr1 cmp-op reg(cr2), Gsr1 set-op reg(srs) [, button=hl_bn]
60set-op1cmp-opsr1sr2*cr1*cvalhl_bn LnkCmpSetLnkGsr1 cmp-op #cval, Gsr1 set-op reg(srs) [, button=hl_bn]
61set-op0cmp-opsr1svalcr1*cr2*hl_bn LnkCmpSetLnkGsr1 cmp-op reg(cr2, Gsr1 set-op #sval [, button=hl_bn]
61X1X Illegal CmpSetLnk
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

Instructions using values not mentioned in this table are invalid.
Code0123456789ab
SET opnonemov
=
swp
<->
add
+=
sub
-=
mul
*=
div
/=
mod
%=
rnd
 
and
&=
or
|=
xor
^=
CMP opnoneBC
&
EQ
==
NE
!=
GE
>=
GT
>
LE
<=
LT
<
 

Link subset codes

67<- Byte
7-21-07-54-0<- Bits
operand 3MnemonicOperands
X 00NOP 
hl_bn 01LinkTopCell[button=hl_bn]
hl_bn 02LinkNextCell[button=hl_bn]
hl_bn 03LinkPrevCell[button=hl_bn]
hl_bn 05LinkTopPG[button=hl_bn]
hl_bn 06LinkNextPG[button=hl_bn]
hl_bn 07LinkPrevPG[button=hl_bn]
hl_bn 09LinkTopPGC[button=hl_bn]
hl_bn 0aLinkNextPGC[button=hl_bn]
hl_bn 0bLinkPrevPGC[button=hl_bn]
hl_bn 0cLinkGoupPGC[button=hl_bn]
hl_bn 0dLinkTailPGC[button=hl_bn]
hl_bn 10RSM[button=hl_bn]
XX04, 08, 0E, 0F, 11-1Finvalid 

SetCLnk:Type 4: Set then Compare & Link.

1) Set.
2) Compare SRD and CR2.
If TRUE:
If FALSE:

CSetCLnk:Type 5: Compare then Set & Link.

1) Compare CR1 and CR2.
If TRUE:
If FALSE:

CmpSetLnk:Type 6: Compare then Set, followed by Link.

1) Compare CR1 and CR2.
If TRUE:
If FALSE:
CmpSetLnk: SetCLnk: CmpSet: SetLnk: CmpLnk:
DVD-Video home