private MaskValue combineInstructionMasks(List<byte[]> masks, List<byte[]> values, int length) {

		if (masks.size() != values.size()) {
			throw new IllegalArgumentException();
		}

		/*
		 * This portion of code takes the masks and values from each of the 
		 * different commands and concatenates them together to form
		 * a single mask and value byte array. 
		 */
		byte[] finalValueArray = new byte[length];
		byte[] finalMaskArray = new byte[length];
		int index = 0;
		for (int x = 0; x < values.size(); x++) { //iterates through each mnemonic

			for (int i = 0; i < values.get(x).length && index < length; i++) {
				finalValueArray[index] = values.get(x)[i];
				finalMaskArray[index] = masks.get(x)[i];
				index++;
			}
		}

		return new MaskValue(finalMaskArray, finalValueArray);
	}
Combines all the masks in the data-structure together into a single byte
stream.

@param masks
@param values
@param length
@return
Ghidra/Features/Base/src/main/java/ghidra/features/base/memsearch/mnemonic/MaskGenerator.java