Index: trunk/BNS/bnseph.cpp
===================================================================
--- trunk/BNS/bnseph.cpp	(revision 930)
+++ trunk/BNS/bnseph.cpp	(revision 931)
@@ -389,5 +389,7 @@
 
   // 5 LSBs of iod are equal to 5 LSBs of tb, remaining bits are zero
-  unsigned int iod = tb << 3;
-  return (iod >> 3);
-}
+  // ----------------------------------------------------------------
+  const int shift = sizeof(tb) * 8 - 5;
+  unsigned int iod = tb << shift;
+  return (iod >> shift);
+}
