The basics of RedcodeRISC as posted to rec.games.corewar on 10 june 1994
written by Brian Connors, Boston College '97 (connorbd@bcvms.bc.edu)

The MARS simulator is only one step in complexity above the standard, since it
adds a stack or two to the process queue for each player.  Programs are larger,
with most of the overhead incurred in the math routines, which are done with
signed numbers and push/pop/collapse stack operations.  The instruction set is
very basic, providing a bare minimum of operations in order to do things. Also,
absolute addressing is allowed; see entry on _data_ for details.

This is the basic set of instructions (* denotes not present in current
proposal):

syntax
    operation value,memory

comp (=cmp)
        compares value to memory; if equal skips to instruction after next else
        continues to next instruction

data (=dat)
        *memory arg is optional; if used puts the data at absolute address
        specified. (Note that absolute addresses should be preceded with a
        denoting character; my preference is >. Without this the argument is
        either considered a relative address or (with _data_) ignored.)

move (=mov)
        moves value to address

jump (=jmp)
        transfers program execution to given address; value is ignored
spl
        splits processes off.  Value represents number of processes; memory
        gives location to split to.  Was named _fork_ in proposal.

push
        pushes value onto a warrior's integer stack (as opposed to any others
        it might have).  Using a memory argument does the same thing with an
        address on a different stack; this, however, may be questionably useful.

pop
        pops the stack and puts the output in either a variable specified in

cols
        collapses the stack, outputting the result to a variable specified in
        value.  This 'collapse' operation basically amounts to addition of
        signed integers on the stack and replaces both addition and subtraction
        operations.

sign
        changes the sign of a variable in value, but not a constant.

Notes:

Value can be anything you can stick in a variable.
Address is noted (see _data_) with either a signed integer (relative) or an
unsigned value preceded by a marker (absolute).
All math is done with stack operations and signed integers.

Pseudo-ops
eq
        equals; not really necessary but it helps readability.

main
        value denotes point to begin execution.

Standard variables

coresize
        size of execution space.  Depends on rules of implementation.

maxproc
        number of allowable active processes; exceeding this is illegal and
        results in a default to the other side.

maxjump
        If implemented, this places a limit on the maximum jump a program can
        make.  Makes things interesting.

maxstack
        Maximum number of values on stack; an overflow will trigger an
        autocollapse.

time
        How long will the match run?

dist
        How far apart will the warriors start out?  Not required.

Basic MARS setup:

Each player has a stack and a process queue.  Both of these are to be displayed
in the debugging display.  As this is a proposal only, it's up to the
implementor as to whether to make the stack vulnerable to enemy attack.  The
MARS interpreter, if possible, should be able to compile ICWS '88 or '94
warriors, but this is hardly necessary.  All the same, it'd be kind of
interesting...

Well, that's the basic idea.  It's actually a bit better than the proposal I had
but we still don't have the RISC dwarf...
