User:I am islptng/SingleOperandAssembly

From Esolang
Jump to navigation Jump to search

Instructions

The RISC has 16 instructions, each of them has exactly 1 operand.

The computer has a register to store the result of calculations.

Hex Keyword Meaning
0 imd x reg = x
1 jmp x pc = x
2 jnz x if(reg != 0) pc = x
3 jlz x if(reg < 0) pc = x
4 get x reg = ram[x]
5 put x ram[x] = reg
6 rget x reg = ram[ram[x]]
7 rput x ram[ram[x]] = reg
8 add x reg += ram[x]
9 sub x reg -= ram[x]
A and x reg &= ram[x]
B or x reg |= ram[x]
C xor x reg ^= ram[x]
D rol x (reg >> (8 - ram[x]))
E shr x reg >>= ram[x] (logic)
F ashr x reg >>= ram[x] (arithmetic)