public AssemblyPatternBlock writeContextOp(ContextOp cop, MaskedLong val) {
		// Do not consider compatibility (like in combine). Just overwrite.
		// This includes overwriting knowns with unknowns.

		// Take out of object early to reduce garbage.
		long vval = val.longValue();
		long vmsk = val.getMask();
		long cmsk = cop.getMask() & 0xffffffffL;

		vval <<= cop.getShift();
		vmsk <<= cop.getShift();
		vval &= cmsk;
		vmsk &= cmsk;

		int idx = cop.getWordIndex();

		int newOffset = Math.min(idx * 4, this.offset);
		int length = Math.max(idx * 4 + 4, this.length());

		byte[] newMask = new byte[length - newOffset];
		byte[] newVals = new byte[length - newOffset];
		System.arraycopy(this.mask, 0, newMask, this.offset - newOffset, this.mask.length);
		System.arraycopy(this.vals, 0, newVals, this.offset - newOffset, this.vals.length);

		for (int i = 3; i >= 0; i--) {
			newMask[idx * 4 + i] &= ~cmsk & 0xff;
			newMask[idx * 4 + i] |= vmsk & 0xff;
			newVals[idx * 4 + i] &= ~cmsk & 0xff;
			newVals[idx * 4 + i] |= vval & 0xff;
			vval >>= 8;
			vmsk >>= 8;
			cmsk >>= 8;
		}
		return new AssemblyPatternBlock(newOffset, newMask, newVals);
	}
Encode the given value into a copy of this pattern block as specified by a context operation

<p>
<b>NOTE:</b> this method is given as a special operation, instead of a conversion factory
method, because this is a write operation, not a combine operation. As such, the bits
(including undefined bits) replace the bits in the existing pattern block. Were this a
conversion method, we would lose the distinction between unknown bits being written, and bits
whose values are simply not included in the write.

@param cop the context operation specifying the location of the value to encode
@param val the value to encode
@return the new copy with the encoded value
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyPatternBlock.java