Sections
Home
Hills
Infinite Hills
Tournaments
Software
Evolving
Optimizer
Community
Newsletter
Discussion
History
Sections
 
For Beginners
First Steps
FAQ
Guides
Lexicon
Benchmarks
For Beginners
> Home > The Corewar Lexicon > a-Imps

a-Imps


An Imp that uses an instruction of the form
mov.i #STEP, *0 
where STEP in the a-field is the imp step.

A-imps are sometimes used because they can sometimes bust Gates that increment the gate's b-field, if the gate isn't carefully constructed. To see this, consider what happens in the following scenario when an a-imp approaches a Gate: (The asterisk indicates which instruction has just executed.)
--------------------------------------------------------------------------------
gate:  dat     xxx, 1234 
       dat     0,0             ; \\ A-fields must be 0 for all intervening 
       dat     0,0             ; /  instructions 
       ... 
       jmp     0,>gate         ; * increment B-field of gate 

--------------------------------------------------------------------------------
       mov.i   #STEP, *0       ; * imp overwrites the gate 
gate:  mov.i   #STEP, *0 
       dat     0,0 
       dat     0,0 
       ... 
       jmp     0,>gate 

--------------------------------------------------------------------------------
       mov.i   #STEP, *0 
gate:  mov.i   #STEP, *1       ; A-field incremented 
       dat     0,0 
       dat     0,0 
       ... 
       jmp     0,>gate         ; * increment gate 

--------------------------------------------------------------------------------
       mov.i   #STEP, *0 
gate:  mov.i   #STEP, *1       ; * imp 'busts the gate' because the A-field of 
       mov.i   #STEP, *1       ; THIS instruction was 0. 
       dat     0,0 
       ... 
       jmp     0,>gate 

--------------------------------------------------------------------------------
       mov.i   #STEP, *0 
gate:  mov.i   #STEP, *2       ; incremented 
       mov.i   #STEP, *1 
       dat     0,0 
       ... 
       jmp     0,>gate         ; * gate executes 

--------------------------------------------------------------------------------
       mov.i   #STEP, *0 
gate:  mov.i   #STEP, *2 
       mov.i   #STEP, *1       ; * malformed imp continues! 
       mov.i   #STEP, *1 
       dat     0,0 
       ... 
       jmp     0,>gate 
The broken imp instruction mov.i #STEP, *1 will continue until it overwrites the gating code and has busted the gate. The easiest way to counter this is to make the A-field after the gate point to somehwere innocuous.

Warriors which are using a-imps are for example: Candy II, RotPendragon 2, Cascade, Blowrag, Dawn and Digitalis 2002.

© 2002-2005 corewar.info. Logo © C. Schmidt
Main Articles

Paper

QScan

Scanner

Main Articles