Lady Ada Mediates Peace Treaty in Endianness War
There is no universal agreement on the order in which the successive bytes constituting a scalar value are stored. Some machines (so-called big-endian architectures) store the most significant byte first, while others (little-endian architectures) adopt the opposite convention. When porting an application across platforms that use different conventions, programmers need to convert data to the appropriate convention, and this may cause difficulties when exact memory layouts need to be preserved (e.g. for communication with legacy systems).
This paper describes the features of the Ada language that help supporting programmers in these situations, identifies some of their shortcomings, and introduces two novel solutions: a code generation approach based on data representation modeling, and a new representation attribute Scalar_Storage_Order, allowing the byte order convention to be specified for a given composite data structure.
Keywordsendianness retargeting code generation
Unable to display preview. Download preview PDF.
- 1.Ada Rapporteur Group: Controlling bit ordering. Ada Issue AI95-00133, ISO/IEC JTC1/SC22/WG9 (2004), http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ais/ai-00133.txt?rev=1.17, adopted amendment to the Ada 95 standard 
- 5.ISO: Information Technology – Programming Languages – Ada. ISO (February 1995), ISO/IEC/ANSI 8652:1995Google Scholar
- 6.ITU-T: Information technology — Abstract Syntax Notation One (ASN.1): Specification of basic notation. Recommendation X.680 (November 2008)Google Scholar
- 7.ITU-T: Information technology — ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER). Recommendation X.690 (November 2008)Google Scholar
- 9.Protomatics: Transfer Syntax Notation One (TSN.1). Tech. rep., http://www.protomatics.com/tsn1.html
- 10.Swift, J.: Travels into Several Remote Nations of the World. By Lemuel Gulliver (1726)Google Scholar