Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Core War > Skybuck's Chain...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2210 of 2284
Post > Topic >>

Skybuck's ChainSawV6 (bad concept?)

by "Skybuck Flying" <spam@[EMAIL PROTECTED] > Feb 19, 2008 at 07:09 AM

;redcode
;name ChainSawV6
;author Skybuck Flying
;strategy like a linked list
;version 6
;date 9 february 2008
;
; V6 is my best and first attempt at a chainsaw idea, conclusion so far:
;
; Concept seems to be bad, at least for serial threaded corewar, process
in 
between don't do anything and just waste cycles
; also using a single instruction to detect good vs bad copy is bad.
; The keep alive flag works much better, bit more complex but ok.
;

Initialization
 mov.a WarriorCopySource, WarriorCopySourceReset

jmp CheckHeart

WarriorBegin
WarriorLength equ WarriorEnd - WarriorBegin

 ; we can just switch here... cool.
 Switch
  ; swap reset destinations
  mov.x WarriorCopyDestReset, WarriorCopyDestReset

  ; swap heart check destinations
  mul.ab #-1, CheckHeart

  ; swap jump positions
  mov.x WarriorJump, WarriorJump

 ; if the $555 is already there then don't copy it wow nice.
 ; skip over next instruction if heart not present this will result in a 
copy
 ; otherwise switch and check other heart etc.
 CheckHeart
  sne.a #555, $WarriorLength
 jmp Switch

 ; Reset source
 mov.a WarriorCopySourceReset, WarriorCopySource
 mov.b WarriorCopyDestReset, WarriorCopyDest

 ; Reset length
 mov.ab #WarriorLength, WarriorCopyLoop

 ; Copy instruction
 WarriorCopy mov }WarriorCopySource, >WarriorCopyDest

 ; Loop
 WarriorCopyLoop djn WarriorCopy, #WarriorLength

 ; first start with a warrior which copies itself to the back
 ; and then to the front... makes it easier to get the offsets
 ; correctly i think..
WarriorJump spl WarriorEnd, WarriorBegin - 15

 jmp WarriorBegin

WarriorData

 ; Variables
 WarriorCopySource
 WarriorCopyDest
  nop $WarriorBegin, $WarriorEnd

 ; Reset variables
 WarriorCopyDestReset
 WarriorCopyDestForPrevReset
 WarriorCopyDestForNextReset ; -15 needs to be replaced manually 
with -warriorlength
  nop $(WarriorEnd-WarriorCopySource) - 15 * 2, 
$WarriorEnd-WarriorCopySource

 WarriorCopySourceReset
  nop $0, $0

WarriorEnd




 1 Posts in Topic:
Skybuck's ChainSawV6 (bad concept?)
"Skybuck Flying"  2008-02-19 07:09:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 8:44:30 CDT 2008.