private void processOrder5() { BCD10 a = new BCD10(); if (accA == 0) { a.set(controlBoxScript.getKeyboard()); } else { a.set(accumulators[accA]); } if (accB > 0) { effectiveOperand.add(accumulators[accB]); } switch (siriusOpcodeLow) { case 0: // DUMMY break; case 1: if (a.msd() != 0) { setPC(effectiveOperand); } break; case 2: if (!a.isZero()) { setPC(effectiveOperand); } break; case 3: if (flagOVR) { setPC(effectiveOperand); } flagOVR = false; break; case 4: if (a.isNegative()) { setPC(effectiveOperand); } break; case 5: setPC(effectiveOperand); break; case 6: if (a.msd() == 0) { setPC(effectiveOperand); } break; case 7: if (a.isZero()) { setPC(effectiveOperand); } break; case 8: if (!flagOVR) { setPC(effectiveOperand); } flagOVR = false; break; case 9: if (!a.isNegative()) { setPC(effectiveOperand); } break; } }
private void processOrder3() { BCD10 b = new BCD10(); bool wasNegative = accumulators[accA].isNegative(); bool shiftOVR; byte msdB; shiftOVR = (accumulators[accA].digits[9] != 0 && accumulators[accA].digits[9] != 9); if (siriusOpcodeLow < 5) { if (accB > 0) { effectiveOperand.add(accumulators[accB]); } b.setHex64(getMainStore(effectiveOperand.toUInt64())); if (accA == 0) { accumulators[0].set(controlBoxScript.getKeyboard()); } flagOVR |= shiftOVR | (wasNegative != accumulators[accA].isNegative()); } else { if (accB == 0) { b.set(controlBoxScript.getKeyboard()); } else { b.set(accumulators[accB]); } } msdB = b.msd(); // in case accA = accB ... for (int i = 9; i > 0; i--) { accumulators[accA].digits[i] = accumulators[accA].digits[i - 1]; } accumulators[accA].digits[0] = 0; switch (siriusOpcodeLow) { case 0: accumulators[accA].add(b); flagOVR |= BCD10.flagOVR; break; case 1: accumulators[accA].sub(b); flagOVR |= BCD10.flagOVR; break; case 2: accumulators[accA].negSub(b); flagOVR |= BCD10.flagOVR; break; case 3: accumulators[accA].negAdd(b); flagOVR |= BCD10.flagOVR; break; case 4: accumulators[accA].digits[0] = msdB; break; case 5: accumulators[accA].add(b); break; case 6: accumulators[accA].sub(b); break; case 7: accumulators[accA].negSub(b); break; case 8: accumulators[accA].negAdd(b); break; case 9: accumulators[accA].digits[0] = msdB; break; } }