Wiki 9Minecraft Wiki 9Minecraft

Programming & Assembly Language in Minecoprocessors

Guides 3FAQ 7Blocks 2Recipes 2Related mods 48
DownloadMinecoprocessors

Get the files on 9Minecraft

Contents (5)
  1. Registers
  2. Port Bitmask (ports)
  3. Instruction Set
  4. Next guides
  5. More in this wiki

The mod uses a custom assembly language. Each line of code represents one instruction.

Registers

Registers are internal memory slots used to store and manipulate data.

Register Type Description
A, B, C, D General Purpose Used for variables and arithmetic.
ports Configuration A bitmask used to set ports as Input (0) or Output (1).
PF, PB, PL, PR, PT, PD I/O Front, Back, Left, Right, Top, and Down ports.

Port Bitmask (ports)

The ports register uses a 4-bit or 6-bit binary value to define port direction. The bit order is typically: [Bottom][Top][Right][Left][Back][Front] Example: mov ports, 0010b sets the Back port as an output/active port for monitoring.

Instruction Set

Instruction Syntax Description
MOV mov dest, src Copies the value from source to destination.
ADD add dest, src Adds source to destination.
SUB sub dest, src Subtracts source from destination.
MUL / DIV mul dest, src Multiplies or divides destination by source.
CMP cmp val1, val2 Compares two values and sets internal flags.
INC / DEC inc reg / dec reg Increases or decreases a register by 1.
JMP jmp label Jumps to a specific label in the code.
JZ / JNZ jz label Jump if Zero / Jump if Not Zero.
CALL / RET call label Calls a subroutine and returns.
NOP nop No Operation (waits for 1 tick).
SLEEP sleep Pauses execution until an external signal is received.