public static void getPcodeForPutField(PcodeOpEmitter pCode, int index,
			AbstractConstantPoolInfoJava[] constantPool) {
		//determine the computational category and push a value of the correct size onto the operand stack
		String descriptor = getDescriptorForFieldRef(constantPool, index);

		switch (descriptor.charAt(0)) {
			case DescriptorDecoder.BASE_TYPE_BYTE:  //signed byte
				pCode.emitPopCat1Value(NEW_VALUE);
				pCode.emitPopCat1Value(OBJECT_REF);
				pCode.emitAssignVarnodeFromPcodeOpCall(FIELD_OFFSET, 4,
					ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index),
					ConstantPoolJava.CPOOL_PUTFIELD);
				pCode.emitTruncate(TEMP_1, 1, NEW_VALUE);
				pCode.emitWriteToMemory(PcodeOpEmitter.RAM, 1, FIELD_OFFSET,
					TEMP_1);
				break;
			case DescriptorDecoder.BASE_TYPE_BOOLEAN:  //boolean
				pCode.emitPopCat1Value(NEW_VALUE);
				pCode.emitPopCat1Value(OBJECT_REF);
				pCode.emitAssignVarnodeFromPcodeOpCall(FIELD_OFFSET, 4,
					ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index),
					ConstantPoolJava.CPOOL_PUTFIELD);
				pCode.emitTruncate(TEMP_1, 1, NEW_VALUE);
				pCode.emitWriteToMemory(PcodeOpEmitter.RAM, 1, FIELD_OFFSET,
					TEMP_1);
				break;
			case DescriptorDecoder.BASE_TYPE_CHAR:  //char
				pCode.emitPopCat1Value(NEW_VALUE);
				pCode.emitPopCat1Value(OBJECT_REF);
				pCode.emitAssignVarnodeFromPcodeOpCall(FIELD_OFFSET, 4,
					ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index),
					ConstantPoolJava.CPOOL_PUTFIELD);
				pCode.emitTruncate(TEMP_1, 2, NEW_VALUE);
				pCode.emitWriteToMemory(PcodeOpEmitter.RAM, 2, FIELD_OFFSET,
					TEMP_1);
				break;
			case DescriptorDecoder.BASE_TYPE_SHORT:  //signed short
				pCode.emitPopCat1Value(NEW_VALUE);
				pCode.emitPopCat1Value(OBJECT_REF);
				pCode.emitAssignVarnodeFromPcodeOpCall(FIELD_OFFSET, 4,
					ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index),
					ConstantPoolJava.CPOOL_PUTFIELD);
				pCode.emitTruncate(TEMP_1, 2, NEW_VALUE);
				pCode.emitWriteToMemory(PcodeOpEmitter.RAM, 2, FIELD_OFFSET,
					TEMP_1);
				break;
			case DescriptorDecoder.BASE_TYPE_ARRAY:  //array dimension
			case DescriptorDecoder.BASE_TYPE_FLOAT:  //float
			case DescriptorDecoder.BASE_TYPE_INT:  //int
			case DescriptorDecoder.BASE_TYPE_REFERENCE:  //object reference
				pCode.emitPopCat1Value(NEW_VALUE);
				pCode.emitPopCat1Value(OBJECT_REF);
				pCode.emitAssignVarnodeFromPcodeOpCall(FIELD_OFFSET, 4,
					ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index),
					ConstantPoolJava.CPOOL_PUTFIELD);
				pCode.emitWriteToMemory(PcodeOpEmitter.RAM, 4, FIELD_OFFSET,
					NEW_VALUE);
				break;
			case DescriptorDecoder.BASE_TYPE_DOUBLE:  //double
			case DescriptorDecoder.BASE_TYPE_LONG:  //long
				pCode.emitPopCat2Value(NEW_VALUE);
				pCode.emitPopCat1Value(OBJECT_REF);
				pCode.emitAssignVarnodeFromPcodeOpCall(FIELD_OFFSET, 4,
					ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index),
					ConstantPoolJava.CPOOL_PUTFIELD);
				pCode.emitWriteToMemory(PcodeOpEmitter.RAM, 8, FIELD_OFFSET,
					NEW_VALUE);
				break;
			default:
				throw new IllegalArgumentException("Invalid descriptor: " + descriptor);
		}

		/*JavaComputationalCategory category = DescriptorDecoder.getComputationalCategoryOfDescriptor(descriptor);
		switch (category){
			case CAT_1:
				//top of operand stack is NEW_VALUE, the new value for the field
				//next on stack is OBJECT_REF, a pointer to the object whose field is to be modified
				PcodeTextEmitter.emitPopCat1Value(pCode, NEW_VALUE);
				PcodeTextEmitter.emitPopCat1Value(pCode, OBJECT_REF);
				PcodeTextEmitter.emitAssignVarnodeFromPcodeOpCall(pCode, FIELD_OFFSET, 4, ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index), ConstantPoolJava.CPOOL_PUTFIELD);
				PcodeTextEmitter.emitWriteToMemory(pCode, PcodeTextEmitter.RAM, 4, FIELD_OFFSET, NEW_VALUE);
				break;
			case CAT_2:
				PcodeTextEmitter.emitPopCat2Value(pCode, NEW_VALUE);
				PcodeTextEmitter.emitPopCat1Value(pCode, OBJECT_REF);
				PcodeTextEmitter.emitAssignVarnodeFromPcodeOpCall(pCode, FIELD_OFFSET, 4, ConstantPoolJava.CPOOL_OP, OBJECT_REF, Integer.toString(index), ConstantPoolJava.CPOOL_PUTFIELD);
				PcodeTextEmitter.emitWriteToMemory(pCode, PcodeTextEmitter.RAM, 8, FIELD_OFFSET, NEW_VALUE);
				break;
			default:
				throw new IllegalArgumentException("Bad computational category for descriptor " + descriptor);
		}
		return pCode.toString();*/
	}
Generate pcode for a putfield op
@param pCode is the pcode accumulator
@param index - the index of the field reference in the constant pool
@param constantPool - the constant pool
Ghidra/Processors/JVM/src/main/java/ghidra/app/util/pcodeInject/ReferenceMethods.java