DCoreWars Extended Instructions

The following special instructions are not part of the standard MIPS instruction set, but are required by the DCoreWars game. Each instruction is given with a ``standard'' MIPS instruction that it replaces (obviously, those instructions have been omitted from the DCoreWars instruction set). Each of the following instructions should use the exact same binary coding pattern as the corresponding MIPS instruction that it replaces.

Extended instructions available only in DCoreWars. The instructions hlt and frk are available in both uniprocessor and distributed versions of the game; the instructions open, close, rsw, and rfrk are available only in the distributed version.
Instruction Replaces Description
hlt break Halt -- terminates the current PROCESS and removes it from the current PROCESS GROUP.
frk $s lb Fork -- create a new PROCESS within the same PROCESS GROUP as the executing PROCESS. The new PROCESS is initialized as specified by the rules (Section 3.1), and its PC is set from $s.
open $s lbu Open connection to the remote RVM whose address is given by register $s. If the connection is successful, 1 is stored in $s, otherwise 0 is stored in $s. When a successful connection is made, the SOCKET of the executing PROCESS is initialized to a record of the remote RVM. Attempting to open a new connection when the process already has an open SOCKET is an ILLEGAL OPERATION for the executing process. Attempting to open a connection to a non-existent RVM is not illegal, but does cause the open operation to fail.
close lh Close the current remote connection (if any) and reset the SOCKET of the currently executing process to empty. Executing this instruction when there is no open SOCKET (e.g., before executing open or after an unsuccessful open) has no effect.
rsw $s, $t lhu Remote Store Word -- write the contents of register $s to the address $t on the remote RVM specified by the executing PROCESS's SOCKET. If the operation succeeds, a 1 is stored in register $s, otherwise a 0 is. Attempting to execute rsw when there is no open SOCKET available (e.g., before executing open or after an unsuccessful open) is an ILLEGAL OPERATION for the executing PROCESS.

Executing this instruction actually causes the specified word to be buffered in an incoming data buffer for the remote machine. All such buffers are of finite, bounded length. If a buffer is full when this instruction is executed, the word is dropped (not inserted into the incoming data buffer) and this instruction fails (causing 0 to be stored in $s).

rfrk $s lwl Remote Fork -- create a new PROCESS on the remote RVM specified by the executing PROCESS's SOCKET. If the remote RVM already has a PROCESS GROUP with the same ID as the executing process, the new, remote PROCESS is created in that PROCESS GROUP. If the remote RVM does not have such a PROCESS GROUP, a new PROCESS GROUP with the same ID as the currently executing PROCESS's GROUP is created on the remote RVM and the new, remote PROCESS is created in that group. Attempting to execute rfrk when there is no valid SOCKET available (e.g., before executing open or after an unsuccessful open) is an ILLEGAL OPERATION error for the executing PROCESS.
     

Terran Lane 2004-03-29