Welcome to GameHourz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Demonstration: CloackTechnologyV4 (little optimization, tw..

 
   Game Forums (Home) -> Core War RSS
Related Topics:
Demonstration: Cloack/Decloack Technology V3 :) - ;redcode ;name ;author Skybuck Flying ;strategy ;version 3 ;date 26 january 2008 ; I am a bit bored right now, so let's do something usefull and write a ; little bit of code which I might re-use later or..

Score Surface for 94nop - Hi, some anonymous person (still called for ;-) is so kind to provide access to a pile of I have suggested to calculate one score surface for standard settings. It takes roughly 1000 times the time of one surface to..

Bug in pMARS - Hi, either I don't know how EQUs work or I have found a bug in the parser of pMARS. So far I cound pin it down to: ;name test ;assert CORESIZE == 800 v3 EQU 3 * (3 / 2 + 1) + 3 v4 EQU (CORESIZE - v3) dat.f v3, v4 With the..

KOTH.ORG: Status - ICWS Experimental 94 03/06/06 - Weekly Status on 03/06/06 -=- is up! Meetings held in #corewars -=- Tons of new features on pages -=- *FAQ* page located at: Current Status of the KOTH.ORG ICWS 94..

KOTH.ORG: Status - MultiWarrior 94 03/06/06 - Weekly Status on 03/06/06 -=- is up! Meetings held in #corewars -=- Tons of new features on pages -=- *FAQ* page located at: Current Status of the KOTH.ORG 94 CoreWar..
Author Message
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 1) Posted: Sat Jan 26, 2008 10:56 am
Post subject: Demonstration: CloackTechnologyV4 (little optimization, two instructions reduced)
Archived from groups: rec>games>corewar (more info?)

;redcode
;name CloackTechnologyV4
;author Skybuck Flying
;strategy cloack/decloack demonstration
;version 4
;date 26 january 2008
; I am a bit bored right now, so let's do something usefull and write a
; little bit of code which I might re-use later or just for demonstration
purposes.
; this piece of code / demonstration / demo / routines / CODE LOL
; will show how to completely cloack some instruction and complete de-cloack
; them by using some routines and some loops and some counters and some
p-space.
; ok v2 working, now let's try to optimize it a little bit by getting rid of
the extra
; counter Wink
; extra counter illiminated, counter is now reset by subtracting the
instruction length of it.
; code repeats it self, cloack/decloack/cloack/decloack/cloack/decloack
;
; further optimizations in version 4: post increment operators used to
increment the parameter counters
; for p-space, instead of storing a,b,a,b,a,b,a,b,a,b the parameters are now
stored:
; a,a,a,a,a,a,a,a,b,b,b,b,b,b,b,b,b thereby the counters only need to be
incremented with 1
; making the post increment operators possible with only one instruction Smile
; nop >a, >b (cloack incrementation)
; nop }a, }b (decloack incrementation)

jmp Cloack

; Instructions to be cloacked/decloacked:

InstructionsBegin
InstructionsLength equ InstructionsEnd - InstructionsBegin

nop $555, $666
mov $777, $888
add #999, #1010
spl @1111, @1212
jmp #1313, #1414
dat $1515, $1616
jmz $1717, $1818
sub $1919, $2020

InstructionsEnd

; Counter which will be used to cloack instructions.
Counter dat $0, $InstructionsBegin

Cloack

CloackParameterA stp.ab @Counter, #1
CloackParameterB stp.b @Counter, #(1 + InstructionsLength )
sub @Counter, @Counter

add.ab #1, $Counter
nop >CloackParameterA, >CloackParameterB

djn Cloack, #InstructionsLength
mov #InstructionsLength, -1

; reset counter for decloack
sub.ab #InstructionsLength, $Counter

DeCloack

DeCloackParameterA ldp.a #1, @Counter
DeCloackParameterB ldp.ab #(1 + InstructionsLength), @Counter

add.ab #1, $Counter
nop }DeCloackParameterA, }DeCloackParameterB

djn DeCloack, #InstructionsLength
mov #InstructionsLength, -1

; reset counter for cloack
sub.ab #InstructionsLength, $Counter

jmp Cloack

 >> Stay informed about: Demonstration: CloackTechnologyV4 (little optimization, tw.. 
Back to top
Login to vote
Display posts from previous:   
   Game Forums (Home) -> Core War All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]