The Opcodes of the PRIMA Virtual Machine

return to the applet
All commands are constructed from two sequential bytes. The first byte is interpreted as the command, and the second is interpreted as the address upon which the command acts.

The overflow flag OV can be reset before applying the command by adding a "*" to mnemonic name of the command.

Mnemo Decimal Binary Action
ADD000000000Accu + RAM[Address] --> Accu
ADD*3200100000
SUB100000001 Accu - RAM[Address] --> Accu
SUB*3300100001
AD11000001010 Accu + 1 --> Accu
AD1*4200101010
SB11200001100 Accu - 1 --> Accu
SB1*4400101100
OR200000010Accu OR RAM[Address] -->Accu
OR*3400100010
AND300000011 Accu AND RAM[Address] -->Accu
AND*3500100011
XOR400000100 Accu XOR RAM[Address] -->Accu
XOR*3600100100
NOP800001000Accu --> Accu (Does nothing)
NOP*4000101000
LD900001001RAM[Address] --> Accu
LD*4100101001
LDI1100001011RAM[Address] + 1 --> Accu
LDI*4300101011
LD014000011100 --> Accu
LD0*4600101110
LD115000011111 --> Accu
LD1*4700101111
ST7201001000Accu --> RAM[Address]
ST*10401101000
SL500000101Accu[i] --> Accu[i+1], (0 <= i < 8); 0 --> Accu[0] "LEFT SHIFT"
SL*3700100101
SR600000110 Accu[i] --> Accu[i-1], (0 <= i < 8); 0 --> Accu[8] "RIGHT SHIFT"
SR*3800100110
RR700000111 Accu[i] --> Accu[i-1], (0 < i <= 8); Accu[0] --> Accu[8] "LEFT SHIFT"
RR*3900100111
BU1281X0XXXX0Address --> PC
BU*1601X1XXXX0
BZ13110000011IF Accu=0 THEN Address --> PC
BZ*16310100011
BCY13310000101 IF Accu[8]=1 THEN Address --> PC
BCY*16510100101
BEV19311000001 IF Accu[0]=1 THEN Address --> PC
BEV*22511100001
BLS13710001001 IF Accu[7]=1 THEN Address --> PC
BLS*16910101001
BOVExists only as BOV*
BOV*16110100001IF OV=1 THEN Address --> PC
BSW14510010001 IF SW=1 THEN Address --> PC
BSW*17710110001