reset method Null safety

void reset()

Reset the calculator to its default state.

Implementation

void reset() {
  settings._reset();
  displayMode = DisplayMode.hex;
  integerSignMode = SignMode.twosComplement;
  wordSize = 16;
  for (int i = 0; i < _stack.length; i++) {
    _stack[i] = Value.zero;
  }
  _lastX = Value.zero;
  for (int i = 0; i < _flags.length; i++) {
    _flags[i] = false;
  }
  memory.reset();
  display.window = 0;
  prgmFlag = false;
  _needsSave = true;
}