Article 2095 of rec.games.corewar: Path: hellgate.utah.edu!dog.ee.lbl.gov!agate!howland.reston.ans.net!darwin.sura.net!news-feed-2.peachnet.edu!st6000.sct.edu!not-for-mail From: wsheppar@sct.edu (Wayne Sheppard) Newsgroups: rec.games.corewar Subject: CMP vs B Date: 8 Oct 1993 13:08:18 -0400 Organization: Southern College of Technology, Atlanta Lines: 52 Message-ID: <2946q2\$1317@st6000.sct.edu> NNTP-Posting-Host: 131.144.80.249 CMP scanners vs B-scanners -------------------------- First of all, realize that CMPing 2 locations every 2 cycles will result in a speed of 66% c, if you are able to target the A-operand also. One way to do this is have the A-operand close to the B-operand and bomb everything between (Agony). Another way is to add an offset to the CMP so that the B-operand will then point to where the A-operand was pointing (Iron Gate). Since I am familiar with the latter method, I will explain it in detail. Lets say the CMP statment is CMP 120,100. If the locations are equal, we assume there is nothing there, and add DAT <40,<40 to CMP the next two locations. The CMP would then be CMP 160,140. Now assume that something is at one of those two locations. We bomb the one at the B-operand. We now got him if he was at the B-operand. But he might be hiding at the A-operand. So we now add a different offset DAT <20,<20 to the CMP. Now it becomes CMP 180,160. Now we are able to attack the former A-operand location. We then jump back the the CMP and repeat the process over. Below is some sample code: ;redcode ;name Iron Gate ;author Wayne Sheppard ;strategy CMPscanner dist equ 98 ;must be a multiple of two scan equ dist*2 a add d,@x c cmp a+dist,a slt #20,@x djn a,<7000 mov j,@c x mov s,