@Override
	public void clearRegister(Register register) {
		if (!isFlowActive()) {
			throw new IllegalStateException("Context flow has not be started");
		}
		if (!startAddr.equals(currentAddress)) {
			saveProgramContext(startAddr, currentAddress.previous());
			startAddr = currentAddress;
		}
		if (register.isProcessorContext()) {
			if (contextRegisterValue != null) {
				contextRegisterValue = contextRegisterValue.clearBitValues(register.getBaseMask());
			}
		}
		else {
			Register baseRegister = register.getBaseRegister();
			RegisterValue currentValue = registerStateMap.remove(baseRegister);
			if (currentValue != null && !register.isBaseRegister()) {
				currentValue = currentValue.clearBitValues(register.getBaseMask());
				if (currentValue.hasAnyValue()) {
					registerStateMap.put(baseRegister, currentValue);
				}
			}
		}
	}
Saves the context from the startAddr (inclusive) to the end address (inclusive)
back to the program's stored context.
@param startAddress 
@param endAddress
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/disassemble/DisassemblerContextImpl.java