Friday, 8 October 2010

URISC / OISC: One Instruction Computers

URISC is an abstract computer designed to have a minimal instruction set, only one instruction. URISC is an abbreviation of Ultimate RISC, although technically the machine doesn’t meet the criteria for RISC.

Types of URISC

There are four common types of URISC – MOV, RSSB, SUBLEQ and SUBNEG.

MOV – Transport Triggered Architecture

In a MOV URISC machine there's one instruction with two operands. When the instruction executes, it copies one location in memory to another, using the operands as pointers. Jumps, arithmetic and input / output are achieve with a memory mapped program counter, arithmetic unit and input / output ports.

More information about MOV TTA:

RSSB – Reverse Subtract and Skip if Borrow

The instruction in a RSSB URISC machine is Reverse Subtract and Skip if Borrow. Each instruction has one operand which is a pointer into memory. When the instruction executes, it subtracts the accumulator from a memory location and stores the result in both. If the value in memory was lower than the accumulator, the next instruction will be skipped. The program counter, accumulator and input / output are mapped to memory.

More information about RSSB:

SUBNEG – Subtract and Branch if Negative

Also abbreviated to SBN, a SUBNEG computer uses an instruction with three operands. When executed, SUBNEG subtracts the contents of the first memory location from a second location, storing the result in the second. If the first value was higher than the second, SUBNEG jumps to where the third operand points. Input / output are memory mapped.

More information about SUBNEG:

SUBLEQ – Subtract and Branch if Less than or Equal

SUBLEQ is similar to a SUBNEG computer, but also branches if the contents of the two memory locations is identical.

More information about SUBLEQ:

Other Types of OISC

There have been several attempts to simplify OISC even further.  Here are a couple of examples:

Tuesday, 5 October 2010

Core War - The King of Programming Games

corewar: the war of the programmers
The aim of a programming game is to write a short program that competes towards a goal, usually destroying all opponents or capturing a flag.

There are two main types of programming game:
  • games inspired by RobotWar - programs control a battle robot which moves around an arena firing at opponents – RobotWar was created in the 1970s.
  • games inspired by Darwin - programs attempt to modify and crash the opponent's program. Darwin was first played at Bell Labs in 1961.

Both games have spawned a series of clones, the most popular being CRobots (1985) and Core War (1984).

In Core War players write programs in Redcode, the assembly language of the MARS virtual computer. The aim of the game is to survive while causing all opponents to terminate. There are three basic strategies:

  • paper - programs spawn off new copies in the hope at least one survives.
  • scissors - programs search for opponents and attempt to disable them.
  • stone - programs drops instructions at random hoping to hit the opponent.

A couple of years after A. K. Dewdney introduced Core War a society was formed which organised an annual tournament. The First International Core War Tournament held in the Computer Museum, Boston MA was a great success with a paper coming out on top, Mice by Chip Wendell.

Core War is now played as a King of the Hill tournament. Players submit their program to a hill containing some of the top Core War programs, receiving results a few minutes later. If the program is successful it enters the hill, knocking off the lowest warrior.

Despite being 26 years old Core War still has a community of regular players. Although the major techniques appear to have been discovered new ideas are constantly being tested, occasionally with impressive results. If you’d like to find out more about Core War here are some handy links for new players:

If you’re planning to try your hand at writing a battle program, good luck and may the core be with you!