by Florian Fischer and Dennis C. Bemmann
These tables list all available instructions in RoboCom 3, divided into the
sections Original Language, Extended Instructions and Multitasking.
The tables contain information about the syntax of the command, the
instruction set (ISet) a robot needs to have in order to execute
the instruction and a description of the instruction. Execution times are
not listed in the tables on this page.
Since in many OptionSets some instructions are disabled or take much longer
or shorter to be executed than in a different OptionSet, RoboCom Workshop
automatically generates specific help files for each OptionSet. See the
tables on this page for general information or select one of the documents
below for
The following instructions define the original RoboCom language set. These were the only instructions available in RoboCom (Workshop) until version 2.52.
| Instruction | ISet | Description |
|---|---|---|
| ADD #a, b | 0 | Add b to #a. |
| BJUMP a, b | 0 | Absoulute jump into Bank a instruction b. |
| COMP a, b | 0 | Compares value a und b. If a is not equal to b then the next instruction is executed, else it is skipped. |
| CREATE a, b, c | 2 | Create a robot with a Instruction set b Empty banks c Mobile |
| DIE | 0 | Destroys the robot. |
| JUMP a | 0 | Relative jump for a instructions. |
| MOVE | 0 | Moves the Robot one square. Robot must be mobile. |
| SCAN #a | 1 | Scans a field, result in #a #a=0 ...empty. #a=1 ...enemy #a=2 ...friend |
| SET #a, b | 0 | Sets #a to b. |
| SUB #a, b | 0 | Subtracts b from #a. |
| TRANS a, b | 1 | Transfers bank a to bank b in the other robot. |
| TURN a | 0 | Turn the robot by 90 degrees a=0 ...left else ...right |
The 'extended instructions' are the result of a discussion among RoboCom programmers between 1998 and 2000. They extend the original command set to increase the possibilities for RoboCom programmers. They are only available in the new language standard RC300 and not supported by versions of RoboCom Workshop prior to 3.00.
| Instruction | ISet | Description |
|---|---|---|
| AJUMP a | 0 | Absolute jump to instruction a in the current bank. |
| DIV #a, b | 0 | Divide #a by b. |
| FARSCAN #a, #b, c | 1 | Scans up to c fields straight in front of the bot. The nearest bot's type is stored in #a: #a=0 ...empty. #a=1 ...enemy #a=2 ...friend Its distance is stored in #b. |
| LCOMP a, b | 0 | Skip next instruction if a is less or equal than b. |
| GCOMP a, b | 0 | Skip next instruction if a is greater or equal than b. |
| MAX #a, b | 0 | #a is set to the greater of #a and b. |
| MIN #a, b | 0 | #a is set to the lesser of #a and b. |
| MOD #a, b | 0 | Set #a to the remainder of the integer division #a / b. |
| MUL #a, b | 0 | Multiply #a by b. |
| NCOMP a, b | 0 | Skip next instruction if a is not equal to b. |
| RANDOM #a, b, c | 0 | Generate random number into #a so that b <= #a <= b + c. |
| RTRANS a, b | 1 | Reverse Trans: transfer the remote robot's bank a to your bank b. |
| SLEEP a | 0 | Pause the program execution in this robot for a tasks. |
Multitasking, a concept originally suggested by me, allows a robot to
execute several tasks at the same time. Like in real computers, the tasks
are not REALLY executed at the same time, instead every cycle, only one
task is executed and the next in the next cycle. There is no cycle
overhead only for the capability to execute many tasks at the same time,
but of course the execution of a certain instruction will take longer when
others are executed at the same time too. For a more detailed description
of multitasking see the Multitasking FAQ.
Like the extended instructions, multitasking is only available in the new
language standard RC300 and not supported by versions of RoboCom
Workshop prior to 3.00.
| Instruction | ISet | Description |
|---|---|---|
| BREAK | 0 | Stops execution of the other task(s) entirely and gives your task 100% priority. |
| INIT a, b | 0 | Initialize another task at bank a::instruction b. |
| RESUME | 0 | Resumes the other task(s) if it is currently suspended by SEIZE. |
| SEIZE | 0 | Stops the other task(s) and gives the current task 100% priority until a RESUME is executed. |
| SLEEP a | 0 | Suspend the current task a cycles and give the other tasks 100%
priority. Note: this is the only instruction which always uses real-world cycles, no matter how many tasks are running. |
| QUIT | 0 | Stops the current task entirely. If there are no tasks left, the robot dies ("Unemployment error"). |