Welcome to GameHourz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Demonstration: Cloack/Decloack Technology V3 :)

 
   Game Forums (Home) -> Core War RSS
Next:  Skybuck's Warrior: MultiplyAndConquerV3  
Author Message
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 1) Posted: Sat Jan 26, 2008 10:36 am
Post subject: Demonstration: Cloack/Decloack Technology V3 :)
Archived from groups: rec>games>corewar (more info?)

;redcode
;name CloackTechnologyV3
;author Skybuck Flying
;strategy cloack/decloack demonstration
;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 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

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, #2
sub @Counter, @Counter

add.ab #1, $Counter
add.ab #2, $CloackParameterA
add.ab #2, $CloackParameterB

djn Cloack, #InstructionsLength
mov #InstructionsLength, -1

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

DeCloack

DeCloackParameterA ldp.a #1, @Counter
DeCloackParameterB ldp.ab #2, @Counter

add.ab #1, $Counter
add.a #2, $DeCloackParameterA
add.a #2, $DeCloackParameterB

djn DeCloack, #InstructionsLength
mov #InstructionsLength, -1

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

jmp Cloack

 >> Stay informed about: Demonstration: Cloack/Decloack Technology V3 :) 
Back to top
Login to vote
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 2) Posted: Sat Jan 26, 2008 10:45 am
Post subject: Re: Demonstration: Cloack/Decloack Technology V3 :) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Future improvement idea:

Make two seperate loops:

The first loop cloacks/decloacks the parameter A

The second loop cloackss/decloacks the parameter B

So by making two seperate loops, maybe one loop can be visible while the
other loop is hidden Wink

Bye,
Skybuck.

 >> Stay informed about: Demonstration: Cloack/Decloack Technology V3 :) 
Back to top
Login to vote
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 3) Posted: Sat Jan 26, 2008 11:04 am
Post subject: Re: Demonstration: Cloack/Decloack Technology V3 :) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Drawback is it would make the code a bit slower because of double looping
and counters and such.

Actually it could even be seperated into multiple loops:

Cloack:

1. One loop to cloack parameter A
2. One loop to cloack parameter B
3. One loop to zero parameters

Decloack:

4. One loop to decloack parameter A
5. One loop to decloack parameter B

I just also had an alternative idea:

The loops could be unrolled.

So all instructions could simply be hard code like so:

DeCloackParameterB ldp.ab #1, InstructionsBegin + 0
DeCloackParameterB ldp.ab #2, InstructionsBegin + 1
DeCloackParameterB ldp.ab #3, InstructionsBegin + 2
DeCloackParameterB ldp.ab #4, InstructionsBegin + 3
DeCloackParameterB ldp.ab #5, InstructionsBegin + 4

Then the real program is stored as such:

DeCloackParameterB ldp.ab #0, 0
DeCloackParameterB ldp.ab #0, 0
DeCloackParameterB ldp.ab #0, 0
DeCloackParameterB ldp.ab #0, 0
DeCloackParameterB ldp.ab #0, 0

Then the only thing which needs to happen is to use a counter to fill the
correct parameters.

And then the parameters will be loaded into the final program/destination.

Cool idea.

Extremely fast too.

No looping required, loops can remain small.

Drawbacks:

Easier to kill by bombers, bigger code so maybe easier to spot.

So it has adventages and disadventages.

I think I will try both in the near future.

Bye,
Skybuck.
 >> Stay informed about: Demonstration: Cloack/Decloack Technology V3 :) 
Back to top
Login to vote
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 4) Posted: Sat Jan 26, 2008 12:22 pm
Post subject: Re: Demonstration: Cloack/Decloack Technology V3 :) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hmm neh probably not good idea to split loops to complex to decloack looping
code, and besides the decloacking length is maybe even longer then the loop
itself.

V4 is so far best.

I do have other even more complex ideas Wink

Bye,
Skybuck.
 >> Stay informed about: Demonstration: Cloack/Decloack Technology V3 :) 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Score Surface for 94nop - Hi, some anonymous person (still called "bvowk" for simplicity ;-) is so kind to provide access to a pile of computers. I have suggested to calculate one score surface for standard settings. It takes roughly 1000 times the time of one "no...

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: ;redcode-tiny ;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 -=- irc.KOTH.org is up! Meetings held in #corewars -=- Tons of new features on www.KOTH.org/koth.html pages -=- *FAQ* page located at: www.KOTH.org/corewar-faq.html Current Status of the KOTH.ORG ICWS Experimental 94..

KOTH.ORG: Status - MultiWarrior 94 03/06/06 - Weekly Status on 03/06/06 -=- irc.KOTH.org is up! Meetings held in #corewars -=- Tons of new features on www.KOTH.org/koth.html pages -=- *FAQ* page located at: www.KOTH.org/corewar-faq.html Current Status of the KOTH.ORG Multiwarrior 94 CoreWar..

KOTH.ORG: Status - 94 No Pspace 03/06/06 - Weekly Status on 03/06/06 -=- irc.KOTH.org is up! Meetings held in #corewars -=- Tons of new features on www.KOTH.org/koth.html pages -=- *FAQ* page located at: www.KOTH.org/corewar-faq.html Current Status of the KOTH.ORG 94 No Pspace CoreWar Hill...
   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 ]