Or I could be totally wrong. I don't really know etherium that well.
Or I could be totally wrong. I don't really know etherium that well.
9.4.3. Jump Destination Validity. We previously used D as the function to determine the set of valid jump destinations given the code that is being run. We define this as any position in the code occupied by a JUMPDEST instruction. All such positions must be on valid instruction boundaries, rather than sitting in the data portion of PUSH operations and must appear within the explicitly defined portion of the code (rather than in the implicitly defined STOP operations that trail it).
I didn't consider implementing another spec though. Theoretically, should be possible, but I'll have to think about it some more!
-Writing a Redcode assembler
-A contiguous address space of up to 8000 units, with circular memory (i.e all addresses are computed mod the size of the address space.), and a segregated, program-specfic address space (typically 1/16 the size of the full address space), if you're implementing ICWS '94
-Writing an actual Redcode VM, with support for all 16 (7168, actually, counting the different addressing modes) instructions, and process queues for each program.
Notably, all instructions take up one slot in RAM, and take one cycle to execute, after which control is passed to the program which has executed least recently, specifically the process in the program's process queue that has run least recently.
Finally, all assembled programs must be inserted into ram, and the emulator is started.
See, not hard at all!
No, seriously.
If you're interested, the ICWS '94 draft (ICWS died before it was ratified, but it remains the most popular dialect available today) is available at http://corewar.co.uk/standards/icws94.htm. A. K. Dewdney's orginal articles in Scientific American describe the origins of the language, as well as the oldest dialect of Redcode, if you're interested in implementing that, as wellas describing the basics of how to play. They're also just cool reads. They can be found at http://www.koth.org/info/akdewdney/. Dewdney's Corewars guidelines, from '84, are also of interest http://corewar.co.uk/standards/cwg.txt. The Corewar wikipedia article is also informative.
Finally, http://corewar.co.uk, and http://koth.org have links to a wide variety of resources about the game.