Article 2596 of rec.games.corewar: Newsgroups: rec.games.corewar Path: hellgate.utah.edu!dog.ee.lbl.gov!ihnp4.ucsd.edu!swrinde!cs.utexas.edu!math.ohio-state.edu!cyber2.cyberstore.ca!nntp.cs.ubc.ca!utcsri!newsflash.concordia.ca!sifon!cidsv01.cid.aes.doe.ca!devw751.ice.ncr.doe.ca!ojastej From: ojastej@devw751.ice.ncr.doe.ca (James Ojaste) Subject: Multi-pass core clears Message-ID: Sender: news@cid.aes.doe.ca (Network News) Reply-To: jojaste@descartes.uwaterloo.ca Organization: Organization? Here? You must be kidding! Date: Thu, 17 Mar 1994 13:35:12 GMT Lines: 62 Well, the article in the '94 Warrior prompted me to write this... Recently, I submitted a couple of programs, Silly and Silly2 to the experimental hill. Each was based on the concept that small things don't get killed easily - so each consists of only a multi-pass core clear. Here's Silly: dat1 dat >-5000, >-5000 trg dat >-5000, >3 start mov dat1, >trg jmp start, >-5000 end start The mov/jmp is just a standard '88 core clear, except that it goes forward instead of backwards, and if someone executes one of the dats, the >-5000 is there to take a potshot at any imp-spirals around (same with the jmp). A while ago a "gate crashing" spiral was posted - it relied on the first process being decremented to survive, so I'm incrementing. Here's Silly2 - much more interesting: imp equ -5000 safe equ 10 ammo dat >imp, spl0 dest dat >imp, >safe+200 start mov @ammo, >dest ; loop jmp start, >imp ; dat0 dat >imp, >spl0-ammo spl0 spl 0, >dat0-ammo end start What Silly2 does is wipe the core alternately with spl0s and dats (ie spl0, dat, spl0, dat, etc). The idea is that a process might have seen the corewipe coming and moved (or just moved blindly), and so we'd have to try to catch it again with spl0s. Again this is a forward coreclear, with anti-imp increments wherever I had space. As the coreclear starts, ammo points to the spl0 - so the core is wiped once with the split, until it wraps around and overwrites ammo. Now ammo is pointing to one less than the split (ie. the dat), so we overwrite the next location with the dat. That location happens to be the dest, so after the mov, the dest points at the spl0 - but remember, it's PRE-increment indirect, so our spl0 doesn't get overwritten. On the next pass, the dat overwrites the ammo, which now points back to the spl0, and the cycle starts over again. This type of corewipe is much harder to write than Silly, and doesn't seem to be doing much better on the hill (because of it's size? Or just that the first wipe takes most programs out?). I'm going to rewrite this using a spl0 instead of a loop... I'll post when I'm done. Enjoy! -- main(){char n[]="James Ojaste\r";int x,y=12;while(y--,x=y)while(x--)putc(' ',0);printf("%s",n+y);}