@Override
	public String getOffsetValue(CodeUnit cu) {
		Address addr = cu.getAddress();
		String text = "";
		MemoryBlock block = cu.getProgram().getMemory().getBlock(addr);
		if (block != null) {
			long offset = addr.subtract(block.getStart());
			text = String.format(useHex ? "0x%x" : "%d", offset);
			if (showName) {
				text = "%s:%s".formatted(block.getName(), text);
			}
		}
		return text;
	}
Creates a new {@link MemoryBlockOffsetFieldFactory}

@param model the {@link FieldFormatModel} that the field belongs to
@param hlProvider the {@link ListingHighlightProvider}
@param displayOptions the {@link Options} for display properties
@param fieldOptions the {@link Options} for field specific properties
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/MemoryBlockOffsetFieldFactory.java