private List<Register> getSetRegisters(Function function) {
		Program program = function.getProgram();
		ProgramContext programContext = program.getProgramContext();
		Register[] registers = programContext.getRegistersWithValues();
		Address address = function.getEntryPoint();
		List<Register> setRegisters = new ArrayList<>();
		for (Register register : registers) {
			if (register.isHidden() && !showHiddenRegisters) {
				continue;
			}

			RegisterValue regVal =
				showDefaultValues ? programContext.getRegisterValue(register, address)
						: programContext.getNonDefaultValue(register, address);

			if (regVal != null && regVal.hasValue()) {
				setRegisters.add(register);
			}
		}
		if (setRegisters.size() > 1) {
			List<Register> dedupedRegisters = new ArrayList<>();
			for (Register register : setRegisters) {
				Register parent = register.getParentRegister();
				if (parent == null || !setRegisters.contains(parent)) {
					dedupedRegisters.add(register);
				}
			}
			setRegisters = dedupedRegisters;
		}
		Collections.sort(setRegisters, regComp);
		return setRegisters;
	}
Field to show register values at the function entry point.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/RegisterFieldFactory.java