private AddressSet getProgramContextDifferences(AddressSetView addressSet, TaskMonitor monitor)
			throws ProgramConflictException, CancelledException {
		AddressSet differences = new AddressSet();

		if (!ProgramMemoryComparator.sameProgramContextRegisterNames(program1, program2)) {
			throw new ProgramConflictException(
				"Program Context Registers don't match between the programs.");
		}

		// Check each address range from the address set for differences.
		AddressSet inCommon = pgmMemComp.getAddressesInCommon();
		addressSet = (addressSet != null) ? inCommon.intersect(addressSet) : inCommon;

		ProgramContext pc1 = program1.getProgramContext();
		ProgramContext pc2 = program2.getProgramContext();

		for (String element : pc1.getRegisterNames()) {
			monitor.checkCancelled();
			Register rb1 = pc1.getRegister(element);
			Register rb2 = pc2.getRegister(element);
			if (rb1.isProcessorContext() || rb2.isProcessorContext()) {
				continue; // context handled with CodeUnit differencing
			}
			Register p1 = rb1.getParentRegister();
			Register p2 = rb2.getParentRegister();
			if (p1 != null && p2 != null && p1.getName().equals(p2.getName())) {
				continue;
			}

			getProgramContextDifferences(pc1, rb1, pc2, rb2, addressSet, differences, monitor);
		}
		return differences;
	}
Gets the addresses where the Program Context (register bits) differ
between two programs.

@param addressSet the addresses to check for differences.
The addresses in this address set should be derived from program1.
@param monitor the task monitor for indicating the progress of
determining differences. This monitor reports the progress to the user.

@return the addresses of code units where the program context (register
bits values) differs.
The addresses in this address set are derived from program1.

@throws ProgramConflictException if the two programs are not comparable since registers differ.
@throws CancelledException if the user cancelled the Diff.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramDiff.java