public final Equate createEquate(Instruction instruction, int operandIndex, String equateName)
			throws Exception {
		Object[] operandObject = instruction.getOpObjects(operandIndex);
		for (Object object : operandObject) {
			if (object instanceof Scalar) {
				Scalar scalar = (Scalar) object;
				long scalarValue = scalar.getUnsignedValue();
				Equate equate =
					currentProgram.getEquateTable().createEquate(equateName, scalarValue);
				equate.addReference(instruction.getMinAddress(), operandIndex);
				return equate;
			}
		}
		throw new InvalidInputException(
			"Unable to create equate on non-scalar instruction operand at " +
				instruction.getMinAddress());
	}
Creates a new equate on the scalar value
at the operand index of the instruction.
@param instruction the instruction
@param operandIndex the operand index on the instruction
@param equateName the name of the equate
@return the newly created equate
@throws Exception if a scalar does not exist of the specified
operand index of the instruction
Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java