ret.add(wait(inCBD));
ret.add(deliver(inCBD));
ret.add(sendto(out, out.getPath(inCBD.getDataDestination(),null)));
- ret.add(new Instruction.Set(ihorn, false, IgnoreOLC, SetDest.InnerLoopCounter, SetSource.Infinity));
- ret.add(new Instruction.Move(ihorn, false, IgnoreOLC, false, null,false,true,true,true,true,false));
+
+ int count = (int)FleetTwoFleet.CBD_SIZE.getval(startcbd);
+ // FIXME FIXME FIXME!
+ int MAX_ILC = 31;
+ int num_instrs = 0;
+ while(count > 0) {
+ int num = Math.min(count, MAX_ILC);
+ num_instrs+=2;
+ count -= num;
+ ret.add(new Instruction.Set(ihorn, false, IgnoreOLC, SetDest.InnerLoopCounter, num));
+ ret.add(new Instruction.Move(ihorn, false, IgnoreOLC, false, null,false,true,true,true,true,false));
+ }
+ if (num_instrs > ihorn.getInstructionFifoSize()) throw new RuntimeException();
+
return (Instruction[])ret.toArray(new Instruction[0]);
}