edit: oh wow this doesn't look like how i expected
Max instructions: 31
Registers: 4
Ram words: 30
All addresses are 1-based, i.e the number 1 accesses the first value, not the number 0. This is true for the ram, the registers and jumps
--------------------------------------------------------------------
instructions set
--------------------------------------------------------------------
SHIFTL load_reg_id save_reg_id - Shifts a register value away from LSB by 1 (multiplies by 2) and saves the result to another register
SHIFTR load_reg_id save_reg_id - Shifts a register value towards LSB by 1 (divides by 2) and saves the result to another register
IN number - Inputs an 8-bit number to the standby register.
If the input is 0, the computer outputs 0x008000000 and pauses its execution until it receives a number from the input port.
When a value is received, it is then saved in the standby register and the computer continues on to the next instruction.
This is the way to input values from outside the computer.
This means that the number 0 cannot be input from the instruction rom.
To get a zero in the standby register, an empty register can be read.
JUMP jump_pos - Jumps to an address in the instruction rom
JUMPIF_GREATER load_reg_id load_reg_id jump_pos - Jumps if the first register value is greater than the second
JUMPIF_LESS load_reg_id load_reg_id jump_pos - Jumps if the first register value is less than the second
JUMPIF_EQUAL load_reg_id load_reg_id jump_pos - Jumps if the first register value is equal to the second
SUB load_reg_id load_reg_id save_reg_id - Subtracts two register values, and saves the result in another register
ADD load_reg_id load_reg_id save_reg_id - Adds two register values, and saves the result in another register
LREG load_reg_id - Loads the register value into the standby register
SREG save_reg_id - Saves the standby register's value to this register
LRAM load_ram_id - Loads the RAM value into the standby register
SRAM save_ram_id - Saves the standby register's value to this RAM address
DISP - Sends the standby register's value to the output port
HALT - Stops the execution of instructions. Pressing the start button of the computer resumes it.
--------------------------------------------------------------------