+ return;
+ }
+
+ if (executing instanceof Instruction.Set) {
+ Instruction.Set set = (Instruction.Set)executing;
+ switch(set.dest) {
+ case DataLatch:
+ dataLatch = new BitVector(getInterpreter().getWordWidth()).setAndSignExtend(set.immediate);
+ break;
+ case InnerLoopCounter:
+ switch(set.source) {
+ case Infinity:
+ ilc = -1;
+ break;
+ case DataLatch:
+ ilc = 0;
+ for(int i=0; i<FleetTwoFleet.SET_ILC_FROM_IMMEDIATE.valmaskwidth-1; i++)
+ if (dataLatch.get(i))
+ ilc |= (1 << i);
+ break;
+ case Immediate:
+ ilc = (int)set.immediate;
+ break;
+ default:
+ throw new RuntimeException("FIXME!");
+ }
+ break;
+ case OuterLoopCounter:
+ switch(set.source) {
+ case Decrement:
+ olc = Math.max(0,olc-1);
+ if (olc==0) hatchIsOpen = true;
+ break;
+ case DataLatch:
+ olc = 0;
+ for(int i=0; i<FleetTwoFleet.SET_OLC_FROM_IMMEDIATE.valmaskwidth-1; i++)
+ if (dataLatch.get(i))
+ olc |= (1 << i);
+ if (olc==0) hatchIsOpen = true;
+ break;
+ case Immediate:
+ olc = (int)set.immediate;
+ if (olc==0) hatchIsOpen = true;
+ break;
+ default:
+ throw new RuntimeException("FIXME!");
+ }
+ break;
+
+ case TAPL:
+ tapl = (InterpreterPath)set.path;
+ break;
+
+ case Flags: {
+ boolean new_flag_a = false;
+ boolean new_flag_b = false;
+ for(Predicate p : set.newFlagA)
+ switch(p) {
+ case FlagA: new_flag_a |= flag_a; break;
+ case FlagB: new_flag_a |= flag_b; break;
+ case FlagC: new_flag_a |= flag_c; break;
+ case NotFlagA: new_flag_a |= !flag_a; break;
+ case NotFlagB: new_flag_a |= !flag_b; break;
+ case NotFlagC: new_flag_a |= !flag_c; break;
+ }
+ for(Predicate p : set.newFlagB)
+ switch(p) {
+ case FlagA: new_flag_b |= flag_a; break;
+ case FlagB: new_flag_b |= flag_b; break;
+ case FlagC: new_flag_b |= flag_c; break;
+ case NotFlagA: new_flag_b |= !flag_a; break;
+ case NotFlagB: new_flag_b |= !flag_b; break;
+ case NotFlagC: new_flag_b |= !flag_c; break;
+ }
+ flag_a = new_flag_a;
+ flag_b = new_flag_b;
+ break;
+ }
+ default:
+ throw new RuntimeException("FIXME!");
+ }