checkExtendProgramMemory method Null safety

  1. @override
void checkExtendProgramMemory()
override

Throws CalculatorError(4) if there's no room to add seven bytes of program memory.

Implementation

@override
void checkExtendProgramMemory() {
  if (_memory.programNybbles + 14 > _memory.totalNybbles) {
    throw CalculatorError(4);
  }
}