background image
Tech Note #10: Portable Object Code
Ó1997 Bionic Buffalo Corporation; All Rights Reserved.
           19 October 1997
Portable object code will compile and run properly on machines with varying word sizes, byte
orders, and data representations. It is also tested against numerous operating systems. The
same code is used for all machines: we do not maintain a different set of code for each
When it is impossible to create a portable routine, then the non-portable portions are isolated to
a separate library called a portability adaptor. Portability adaptors are written for each runtime
environment, and contain the procedures which are not portable to all other supported
As an example, record locking is handled differently among different operating systems.
Because of this, record locking routines with a standardized API are implemented separately in
the portability adaptors. Because the API is standardized, the portable object code is the same
from one platform to the next.
It is relatively easy to write a portability adaptor for a new environment, especially if an existing
one from a similar environment is used as a model.