public int[] getOperandsThatDiffer(CodeUnit codeUnit1, CodeUnit codeUnit2) {
		int numOperands = codeUnit1.getNumOperands();
		if (codeUnit2 == null) {
			return getAllIndices(numOperands);
		}
		if (codeUnit1 instanceof Instruction && codeUnit2 instanceof Instruction) {
			int otherNumOperands = codeUnit2.getNumOperands();
			// Return indices for whole operand string if number of operands differs.
			if (numOperands != otherNumOperands) {
				return getAllIndices(numOperands);
			}

			// Add each operand index where the operands differ between the two instructions.
			Instruction inst1 = (Instruction) codeUnit1;
			Instruction inst2 = (Instruction) codeUnit2;
			ArrayList<Integer> opIndices = new ArrayList<Integer>();
			for (int opIndex = 0; opIndex < numOperands; opIndex++) {
				Object[] opObjects1 = inst1.getOpObjects(opIndex);
				Object[] opObjects2 = inst2.getOpObjects(opIndex);
				if (opObjectsDiffer(opObjects1, opObjects2)) {
					opIndices.add(opIndex);
				}
			}
			// Convert to int array.
			int[] diffOpIndices = new int[opIndices.size()];
			for (int index = 0; index < diffOpIndices.length; index++) {
				diffOpIndices[index] = opIndices.get(index);
			}
			return diffOpIndices;
		}
		else if (codeUnit1 instanceof Data && codeUnit2 instanceof Data) {
			Data data1 = (Data) codeUnit1;
			Data data2 = (Data) codeUnit2;
			if (isSameData(data1, data2)) {
				return new int[0]; // No operands differ.
			}
		}
		return getAllIndices(numOperands); // All operands differ.
	}
Gets an array containing the operand indices where the two indicated code units differ.
These differences are determined based on whether constants and registers are
being ignored.
@param codeUnit1 the first code unit
@param codeUnit2 the second code unit
@return an array of operand indices where the operands differ between the two code units 
based on the current settings that indicate what differences can be ignored.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ListingDiff.java