Arena Programmer's Hint Sheet
=============================
Opcodes used in Arena Programming
Opcode Parameters Notes
------------------------------------------------------------------------------
MOV
Move in direction
RTS Return from a subroutine
NOP No OPeration. Does nothing.
END End of the program; Restart from beginning.
SET : Sets a register to be equal to a
value .
CMP Compares value to , placing
the result in :C (:C= -).
ADD : Adds to register .
SUB : Subtracts to register .
MUL : Multiplies to register .
DIV : Divides to register .
JMP Moves program execution to line .
JLT If :C < 0 then JMP .
JGT If :C > 0 then JMP .
JEQ If :C = 0 then JMP .
JSR Goto the subroutine at address .
GUN Fire the cannons in direction .
DJZ Jump to address times.
RAD Do a radar scan in direction to a
range of . Place the results in
the :S and :R registers.
MSG Beep and flash the string to the
Controllers.
Notes:
= a legal direction value, between 0 and 7. Greater numbers
are reduced to fit into this range.
: = a CPU register, :A through :Z.
to = a numeric value, from -128 to +127.
= a numeric value between 1 and 30.
= a numeric value representing a line of code. Its range is
between 1 and the maximum lines of code for the robot's
brain size. (Max = Brain * 8).
Registers:
Name Notes
----------------------------------------------------------
:A Accumulator Register. (not used in 2.1)
:B Accumulator Register. (not used in 2.1)
:C Condition code register. Holds the results of CMP tests.
:D Contains the direction of the last MOV command.
:F Contains the direction of the last GUN command.
:G Holds a random value between 0 and 7.
:H The number of damage points taken.
:K Holds the current number of executions for the DJZ command.
:L Holds the actual number of executions needed.
:M The maximum numbner of damage points possible.
:P Program counter.
:R Range of last object scanned.
:S Type of last object scanned:
0 = Nothing, 1 = Friendly -1 = enemy -2 = wall -3 = junk.
:T The direction of the last RAD command.
:X Current X position.
:Y Current Y position.
This leaves: :E,:I,:J,:O,:Q,:U,:V,:W,:Z free.
Richard Brown