private void formatAsAddressVal(Program program, Address addr, Scalar scalar,
			StringBuilder htmlText) {

		// maybe the scalar is an address..
		long scalarLong = scalar.getValue();
		AddressFactory factory = program.getAddressFactory();
		AddressSpace space = factory.getDefaultAddressSpace();
		Address asAddress;
		try {
			asAddress = factory.getAddress(space.getSpaceID(), scalarLong);
		}
		catch (AddressOutOfBoundsException ex) {
			asAddress = null;	// Constant doesn't make sense as an address
		}

		Memory memory = program.getMemory();
		if (asAddress != null && memory.contains(asAddress)) {
			htmlText.append("<hr>");
			htmlText.append("<table>");

			addReprRow(htmlText, "Address", asAddress.toString());

			// .. and maybe it points to some data...
			Data data = program.getListing().getDataContaining(asAddress);
			if (data != null) {
				Symbol primary = data.getPrimarySymbol();
				if (primary != null) {
					addReprRow(htmlText, "Symbol",
						HTMLUtilities.italic(HTMLUtilities.friendlyEncodeHTML(primary.getName())));
				}
			}

			htmlText.append("</table>");
		}
	}
A hover service to show tool tip text for hovering over scalar values.
The tooltip shows the scalar in different bases.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/hover/AbstractScalarOperandHover.java