[2006-04-07] ZINC

ZINC is a variant of the game of Core War in which programmes (called "warriors") fight each other in a battle to control a virtual computer. The programmes are written in a simple language called Redcode and run inside an emulator known as Memory Array Redcode Simulator (MARS). ZINC implements a simpler and more symmetric dialect of the Redcode language than the current International Core War Society (ICWS) standard known as ICWS-94. To get a feel for ZINC and Redcode, look at the following simple warrior:

       ; Bomb every fourth cell in the core with a "DAT #0".       org start     target:       dat #0     start:       add #4, $target       mov #0, @target       jmp $start 
Redcode looks very similar to the assembly language of many modern microprocessors. A DAT #0 instruction indicates the number 0 stored as the datum at that location in memory. This instruction is itself encoded as 0 and is not executable - an attempt to execute this instruction leads to the death of a warrior. So the warrior shown above (called "Dwarf", a classic Core War warrior) bombs every fourth location in the core in the hopes of fatally wounding an opponent. Note that Core War only supports relative addressing and @ represents indirect addressing (the location pointed to contains a pointer to the final location). More details, including a tutorial for beginners, are available in the ZINC User Manual as well as on sites like www.koth.org and www.corewar.info. There is also an active USENET newsgroup rec.games.corewar for Core War enthusiasts. ZINC is currently at version 0.1 and is Free Software released under the GNU General Public Licence (GPL). By the way, I expect to receive a lot of flame for my decision to not recognise TAB characters as whitespace in the Redcode dialect implemented by ZINC.

(Originally posted on Advogato.)

Other Posts from 2006