ASM Hell

User documentation, version 5.9.12(8)-release (x64-torus)

Dedicated to the one always dissatisfied with my typesetting skills. Your comments have been a test to my patience and self-control.

ASM Hell defines instruction set with three types of arguments: immediate value I, memory value M, any value A. Example: 7 is an immediate value, [4] is a memory value, [[2]] is a pointer to [2]th memory bank ([2] must be between 0 - 7, otherwise an error is thrown)

Bugs:

To everyone's great surprise, this game contains bugs. It's mostly input processing.

Commands:

Command Description
MOVE A1 A2 A1 is the amount of steps (can be negative), A2 is the direction (0 for vertical, 1 for horizontal)
WAIT A1 A1 is the amount of cycles to wait
UNLOCK A1 A1 is the key
READ M1 M1 stores the result of tile read instruction
ADD M1 A1 A2 M1 stores the result of A1 + A2
SUB M1 A1 A2 M1 stores the result of A1 - A2
MUL M1 A1 A2 M1 stores the result of A1 * A2
JMP A1 A1 line in code to be jumped to
JMPZ A1 A2 jump to line A1 if A2 is zero
JMPN A1 A2 jump to line A1 if A2 is negative
CMP M1 A1 A2 M1 stores the result of A1 > A2 (B); A1 > A2: 1, A1 = A2: 0, A1 < A2: -1

Solutions:

Normally, this would be considered cheating, but hey, I know some puzzles are not easy and that I flunked the tutorial part.

Show me!