private long encodeOldNamespaceAddr(OldGenericNamespaceAddress addr) {
		switch (addr.getAddressSpace().getType()) {
			case AddressSpace.TYPE_STACK:
				return STACK_ADDR_TYPE_LONG | (addr.getNamespaceID() << ADDR_OFFSET_SIZE) |
					(addr.getOffset() & ADDR_OFFSET_MASK);
			case AddressSpace.TYPE_REGISTER:
				return REGISTER_ADDR_TYPE_LONG | (addr.getNamespaceID() << ADDR_OFFSET_SIZE) |
					(addr.getOffset() & ADDR_OFFSET_MASK);
			case AddressSpace.TYPE_EXTERNAL:
				return EXTERNAL_ADDR_TYPE_LONG | (addr.getNamespaceID() << ADDR_OFFSET_SIZE) |
					(addr.getOffset() & ADDR_OFFSET_MASK);
		}
		throw new IllegalArgumentException("Address can not be encoded");
	}
Provide absolute encoding of an old namespace address for upgrade use.
@param addr old namespace address for stack, register or external
@return encoded address key
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/map/AddressMapDB.java