public static class DecrLoop extends Instruction {
public DecrLoop(Pump pump) { super(pump); }
public boolean isDL() { return true; }
+ public boolean isLooping() { return true; }
}
public static class Counter extends Instruction {
if (executing instanceof Instruction.Counter) {
Instruction.Counter ic = (Instruction.Counter)executing;
if (ic.source == Instruction.Counter.LOOP_COUNTER && ic.dest == Instruction.Counter.DATA_LATCH) {
- setDataLatch(loopCounter);
+ setDataLatch(oldLoopCounter); /* FIXME: which is correct here? */
} else if (ic.dest == Instruction.Counter.LOOP_COUNTER && ic.source == Instruction.Counter.DATA_LATCH) {
loopCounter = (int)peekDataLatch();
} else if (ic.dest == Instruction.Counter.REPEAT_COUNTER && ic.source == Instruction.Counter.DATA_LATCH) {
} else if (ic.dest == Instruction.Counter.REPEAT_COUNTER) {
repeatCounter = ic.source;
}
+
} else if (executing instanceof Instruction.DecrLoop) {
- executing = null;
- return;
+
} else if (executing instanceof Instruction.SetFlags) {
Instruction.SetFlags sf = (Instruction.SetFlags)executing;
boolean old_s = ((peekDataLatch() >> (getInterpreter().getWordSize()-1)) & 1) != 0;