private boolean goToRegisterVariable(Navigatable navigatable, CodeUnit codeUnit,
			OperandFieldLocation loc, GoToService goToService) {

		Address refAddr = loc.getRefAddress();
		Address cuAddr = codeUnit.getMinAddress();
		if (refAddr == null || refAddr.isStackAddress()) {
			return false;
		}

		Program p = codeUnit.getProgram();
		Register reg = p.getRegister(refAddr, 1);
		if (reg == null) {
			return false;
		}

		Variable variable = p.getFunctionManager().getReferencedVariable(cuAddr, refAddr,
			reg.getMinimumByteSize(), !isWrite((Instruction) codeUnit, loc.getOperandIndex(), reg));
		if (variable == null) {
			return false;
		}

		ProgramLocation pl = new VariableNameFieldLocation(navigatable.getProgram(), variable, 0);
		goToService.goTo(navigatable, pl, navigatable.getProgram());
		return true;
	}
A handler to process {@link OperandFieldLocation} mouse clicks.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/OperandFieldMouseHandler.java