private MaskValue getFinalMaskAndValue() {

		List<byte[]> masks = new ArrayList<>();
		List<byte[]> values = new ArrayList<>();
		int totalLength = 0;
		for (int i = 0; i < mnemonics.size(); i++) {

			MaskValue result = buildSingleInstructionMask(mnemonics.get(i));
			byte[] mask = result.getMask();
			byte[] value = result.getValue();
			if (value.length == mask.length) {
				masks.add(mask);
				values.add(value);
				totalLength += value.length;
			}
		}

		return combineInstructionMasks(masks, values, totalLength);
	}
Calculates the final mask and value byte streams. These streams can then
be used to search through memory to look for similar assembly
instructions.
Ghidra/Features/Base/src/main/java/ghidra/features/base/memsearch/mnemonic/MaskGenerator.java