private static Address getSegmentedAddressValue(MemBuffer buf, int dataLen, long storedOffset) {
		SegmentedAddress a = (SegmentedAddress) buf.getAddress();
		int segment = a.getSegment();
		int offset;
		switch (dataLen) {
			case 2: // near pointer
				offset = (int) (storedOffset & 0xffff);
				break;
			case 4: // far pointer
				segment = (int) ((storedOffset >> 16) & 0xffff);
				offset = (int) (storedOffset & 0xffff);
				break;
			default:
				return null;
		}
		SegmentedAddressSpace space = (SegmentedAddressSpace) a.getAddressSpace();
		SegmentedAddress addr = space.getAddress(segment, offset);
		return normalize(addr, buf.getMemory());
	}
Read segmented address from memory. NOTE: little-endian memory assumed.

@param buf     memory buffer associated with a segmented-address space
               positioned at start of address value to be read
@param dataLen pointer-length (2 and 4-byte pointers supported)
@return address value returned as segmented Address object or null for
        unsupported pointer length or meory access error occurs.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/PointerDataType.java