|
|
1.1 ! root 1: .TH MARS 6 ! 2: .SH NAME ! 3: mars \- memory array redcode simulator ! 4: .SH SYNOPSIS ! 5: .B mars ! 6: [ ! 7: .B -dfhmp ! 8: ] ! 9: [ ! 10: .BI -cqs value ! 11: ] ! 12: .I file ... ! 13: .SH DESCRIPTION ! 14: .I Mars ! 15: is a simulator for the ! 16: `Redcode' ! 17: machine from Kee Dewdney,s ! 18: `Computer Recreations,' ! 19: .I Scientific American , ! 20: May, 1984, coded by Michael Mauldin, CMU. ! 21: The easiest way to create an object file is to use the ! 22: .IR redcode (6) ! 23: command to a assemble the object file from a redcode ! 24: source file. ! 25: .PP ! 26: An object file contains three header lines: the name of the ! 27: program, its length, and its starting location. ! 28: Here is a sample redcode object file, for ! 29: the Dwarf program: ! 30: .IP ! 31: .EX ! 32: name dwarf ! 33: length 4 ! 34: start 1 ! 35: 00000007999 ! 36: 20000517999 ! 37: 10000027998 ! 38: 41799800000 ! 39: .EE ! 40: .PP ! 41: The instruction format is an 11 digit decimal string, packed thus: ! 42: .EX ! 43: struct { ! 44: char[1] opcode; ! 45: char[1] mode1; char[4] arg1; ! 46: char[1] mode2; char[4] arg2; ! 47: } ! 48: .EE ! 49: .PP ! 50: Options allow for tracing execution, for graphically displaying the ! 51: progress of each program, and for analyzing and dumping memory before ! 52: and after execution. For example ! 53: .IP ! 54: .L ! 55: mars -s1234 -f -c20000 dwarf.obj gemini.obj imp.obj ! 56: .LP ! 57: specifies that imp, dwarf, and gemini are to be run together, with a ! 58: fullscreen display for 20000 cycles using a random number seed of 1234. ! 59: .TP ! 60: .BI -c N ! 61: the maximum number of cycles for this run. ! 62: The default is 10000. ! 63: .TP ! 64: .B -d ! 65: (debug) ! 66: execution to be traced in excruciating detail. ! 67: .TP ! 68: .B -f ! 69: (fullscreen) ! 70: execution will be displayed graphically on any ! 71: terminal supported by ! 72: .IR curses (3). ! 73: .TP ! 74: .B -h ! 75: (holes) ! 76: description of memory usage will be printed after ! 77: execution terminates. ! 78: .TP ! 79: .B -m ! 80: memory will be dumped before and after execution terminates. ! 81: .TP ! 82: .B -p ! 83: similar to ! 84: .BR -m , ! 85: except only memory near each program counter is dumped. ! 86: .TP ! 87: .BI -q N ! 88: .I ! 89: quit as soon as there are fewer than ! 90: .I N ! 91: programs still alive. ! 92: Default is ! 93: .BR q1 . ! 94: .TP ! 95: .BI -s N ! 96: seed for random number generator; ! 97: .IR N =0 ! 98: seeds from the clock. ! 99: .SH SEE ALSO ! 100: .IR redcode (6)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.