private void applyRegisterValues(Program program, Register register, BigInteger value,
			AddressSetView addressSet) {
		if (program == null || addressSet.isEmpty()) {
			return;
		}

		CompoundCmd<Program> cmd = new CompoundCmd<>("Set Register Values");
		for (AddressRange range : addressSet) {
			SetRegisterCmd regCmd =
				new SetRegisterCmd(register, range.getMinAddress(), range.getMaxAddress(), value);
			cmd.add(regCmd);
		}
		if (!tool.execute(cmd, program)) {
			Msg.showError(this, tool.getToolFrame(), "Register Context Error", cmd.getStatusMsg());
		}
	}
Shows the registers available in a program along with any values that are set.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/register/RegisterPlugin.java