Operations¶
INC¶
This operation is used on 1 register and costs 2 energy units. It adds 1 to the total value stored in the register:
Attention
If the register stores the maximum value (all bits switched on), an overflow happens and the register is reset to zero:
DEC¶
This operation is used on 1 register and costs 2 energy units. It subtracts 1 to the total value stored in the register:
Attention
If all the bits of the register are switched off, subtracting 1 will cause an underflow that sets all the bits of the register to one (switched on):
ROL¶
This operation is used on 1 register and costs 1 energy unit.
It involves shifting every bit on the register to the left and placing the remaining bit on the left in the rightmost position:
Hint
From an arithmetic point of view, in many cases it is equivalent to multiplying the value of the register by 2:
ROR¶
This operation is used on 1 register and costs 1 energy unit.
It involves shifting every bit on the register to the right and placing the remaining bit on the right in the leftmost position:
Hint
From an arithmetic point of view, in many cases it is equivalent to dividing the value of the register by 2:
MOV¶
This operation is used on 2 registers or 1 register and a RAM module and costs 1 energy unit (1/2 in competitive mode).
It copies all bits from one register to another, overwriting the value stored in the destination.
Hint
In competitive mode, it can be useful to copy a value into your RAM module and then recover it later, preventing other players from modifying it.
NOT¶
This operation is used on 1 register and costs 1 energy unit.
It negates every bit on the register: switched-on bits are switched off, and switched-off bits are switched on. This involves flipping all the bits of the register.
OR¶
This operation is used on 2 registers and costs 1/2 energy unit.
It copies only the switched-on bits from one register to another.
NOR¶
AND¶
This operation is used on 2 registers and costs 1/2 energy unit.
It copies only the switched-off bits from one register to another.
NAND¶
XOR¶
This operation is used on 2 registers and costs 1/2 energy unit.
It copies only the switched-on bits from one register to another, but if the bit was already on, it’s turned off.