MERCURY2 by Albert Ma MERCURY2 is an extremely fast and small corewar interpreter without graphical core display. I estimate it to be about 25 times faster than C88v49. It requires a 386 or above and 160K of contiguous free memory. There are two versions of the executable compiled from the same assembly source (see below). MERCURYD.EXE has debugging features; MERCURY2.EXE is optimized for speed. Limits: maximum size of redcode program: 16384 bytes maximum length of program: 1024 instructions maximum number of cells: 8192 maximum number of processes: 16383 maximum number of rounds: 65535 maximum number of cycles: 2^32-1 i.e. a whole lot maximum number of labels and variables: 102 for average length of 7 maximum length of name: 63 characters maximum length of author: 63 characters Compatabilty: Interprets warriors same as KotH requires comma between operands labels composed of A..Z _ 0..9 no limit to length of name all significant Uses in-register evaluation. Instructions for MERCURY2: run MERCURY2 to see options press key after seeing first listing interpreter runs immediately after displaying second file press space to see status press escape to abort The new -U option (coredump) displays all non-empty cells after the last round has completed. Additional instructions for the debugging version: press 's' to step through trace (if tracing) press 't' to step through trace (force tracing) press return to go back to full speed press 'n' to enable/disable debugging Source-embedded debugging commands (debugging version only): ;debug turn on debugging (MOV copies debug info) ;debug static turn on debugging (MOV does not copy debug info) ;debug off turn off debugging ;trace turn on trace starting with next instruction ;trace off turn off trace ;break pause execution at next instruction ;break once break once and then clear debug status (;debug and ;trace off are defaults) Example: ;name Sucker 3 ;strategy vampire ;debug (copy debug info) ;break once (when opponent executes vampire fang) jump jmp clear-444,444 start spl 0 loop sub clear,jump mov jump,@jump djn loop,<4003 ;trace (the next instruction) clear mov 34,<-34 ;trace off spl clear jmp clear end start Pressing 's' after the breakpoint displays the traced instruction 'clear'; pressing 't' steps through all following instructions as they are executed. Traced instructions are displayed in this format:
Compiling mercury2: You need TASM (a new version) unless you know assembly and can make minor modifications to the program. The commands TASM /m10 /ddebugging=0 mercury2 TLINK mercury2 create mercury2.exe without debugging features The commands TASM /m10 /ddebugging=1 mercury2 TLINK mercury2.obj, mercuryd.exe create mercuryd.exe with debugging features Credits: Stefan Strack for all his help and ideas for debugging. MAD for his validation suite which clearly explained in-register Bugs: DO NOT run under DesqView Has not been tested in OS/2 Legal Stuff: This program is freeware. I'd ask that you not try to sell it to anyone. Provided as is, I am not responsible for damage caused by the proper or improper use of my program, *blah blah* expressed or implied *blah blah*. Seriously, I've crashed Stefan's computer hundreds of times during testing, be warned. Feel free to modify the source code in any way you want (except putting viruses inside and distributing it). Send comments or suggestions to ama@athena.mit.edu