private void doSetValue(Address start, Address end, RegisterValue newValue) {
		if (!start.hasSameAddressSpace(end)) {
			throw new IllegalArgumentException(
				"Start and end addresses must be in the same address space.");
		}

		// if newValue corresponds to base and all bits are to be changed - no need to merge
		if (newValue.getRegister().isBaseRegister() && newValue.hasValue()) {
			rangeMap.set(start, end, newValue.toBytes());
			return;
		}

		// Otherwise, combine bytes where values already exist.
		List<AddressRange> list = new ArrayList<AddressRange>();
		AddressRangeIterator rangeIt = rangeMap.getAddressRangeIterator(start, end);
		while (rangeIt.hasNext()) {
			list.add(rangeIt.next());
		}
		for (AddressRange indexRange : list) {
			Address rangeStart = indexRange.getMinAddress();
			Address rangeEnd = indexRange.getMaxAddress();
			if (rangeStart.compareTo(start) > 0) {
				rangeMap.set(start, rangeStart.previous(), newValue.toBytes());
			}
			byte[] currentBytes = rangeMap.getValue(rangeStart);
			RegisterValue currentValue = new RegisterValue(baseRegister, currentBytes);
			RegisterValue combinedValue = currentValue.combineValues(newValue);
			rangeMap.set(rangeStart, rangeEnd, combinedValue.toBytes());
			try {
				start = rangeEnd.addNoWrap(1);
			}
			catch (AddressOverflowException e) {
				return;
			}
		}
		if (start != null && start.compareTo(end) <= 0) {
			rangeMap.set(start, end, newValue.toBytes());
		}
	}
Sets the given register value (contains value and mask) across the given address range.  Any
existing values in the range that have values that are not part of the input mask are 
not changed. 
@param start the start of the range to set the register value. 
@param end the end of the range(inclusive) to set the register value.
@param newValue the new register value to set.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/RegisterValueStore.java