public int getNextOpenSegment(Address addr) {
		int res = (int) addr.getOffset();	// The "flat" offset (presumably real-mode encoded)
		res = (res >> 4) + 1;
		return res;
	}
Get the segment index for the first segment whose start address
comes after the given address
@param addr is the given address
@return the segment index
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/address/SegmentedAddressSpace.java