private int aslW(int dest, int n) {
    clearFlags(SR_N, SR_Z, SR_V, SR_C);
    boolean hibitSet = msbSetW(dest);
    boolean hasOverflow = false;
    int result = dest;
    boolean msbSet;
    for (int i = 0; i < n; i++) {
      msbSet = msbSetW(result);
      if (msbSet) setFlags(SR_X, SR_C);
      else clearFlags(SR_X, SR_C);
      if (hibitSet && !msbSet) hasOverflow = true;
      else if (!hibitSet && msbSet) hasOverflow = true;
      result <<= 1;
    }
    if (n == 0) clearFlag(SR_C);
    if (msbSetW(result)) setFlags(SR_N);
    if (isZeroW(result)) setFlags(SR_Z);
    return result;
  }