private String markupFRegInstruction(Instruction instr, int opIndex, RefType refType) {
		Object[] objs = instr.getOpObjects(opIndex);
		if (objs.length != 1) {
			return null;
		}

		Address addr;
		Register reg = null;
		if (objs[0] instanceof Register) {
			reg = ((Register) objs[0]);
			addr = reg.getAddress();
		}
		else if (objs[0] instanceof Address) {
			addr = (Address) objs[0];
			reg = program.getRegister(addr, 1);
		}
		else if (objs[0] instanceof Scalar) {

//			long offset = ((Scalar)objs[0]).getUnsignedValue();
//			Object[] accessObjs = instr.getOpObjects(instr.getNumOperands()-1);
//			if (objs.length == 1 && "BANKED".equals(accessObjs[0])) {
//				// BANKED mode
//				if (bsrSetAddr == null || !(objs[0] instanceof Scalar)) {
//					return null;
//				}
//				offset += ((long)(bsrVal & 0x0f) << 8);
//			}
//			else {
//				// ACCESS mode
//				offset = ((Scalar)objs[0]).getUnsignedValue();
//			}

			if (!bsrContext.hasValue() || !(objs[0] instanceof Scalar)) {
				return null;
			}
			long offset =
				((bsrContext.longValue() & 0x0f) << 8) + ((Scalar) objs[0]).getUnsignedValue();
			addr = program.getAddressFactory().getAddressSpace("DATA").getAddress(offset);
			reg = program.getRegister(addr);
		}
		else {
			return null;
		}

		// Determine RefType
		String mnemonic = instr.getMnemonicString();
		if (refType == null) {
			refType = RefType.READ;
			if ("CLRF".equals(mnemonic) || "MOVWF".equals(mnemonic) || "LFSR".equals(mnemonic)) {
				refType = RefType.WRITE;
			}
			else if (FREG_BIT_INSTRUCTIONS.contains(mnemonic)) {
				if ("BCF".equals(mnemonic) || "BSF".equals(mnemonic)) {
					refType = RefType.READ_WRITE;
				}
			}
			else if (opIndex == 0 && instr.getNumOperands() == 3) {
				// Detect read/write update of register
				List<?> repObjs = instr.getDefaultOperandRepresentationList(1);
				if (repObjs.size() == 1 && DEST_FREG.equals(repObjs.get(0))) {
					refType = RefType.READ_WRITE;
				}
			}
		}

		if (stkptrReg.equals(reg)) {
			addr = stkptr0Reg.getAddress();
		}

		if (addr.isMemoryAddress()) {
			refMgr.addMemoryReference(instr.getMinAddress(), addr, refType, SourceType.ANALYSIS,
				opIndex);
		}

		return reg != null ? reg.getName() : null;
	}
Attempt to markup FReg access instruction with register reference.

@param instr
@return register name if identified, else null
Ghidra/Processors/PIC/src/main/java/ghidra/app/plugin/core/analysis/Pic18Analyzer.java