Ada Programming/Attributes/'Bit Order:3

From Wikibooks, open books for an open world
Jump to: navigation, search

The 'Bit_Order attribute is not intended to convert data between a big-endian and a little-endian machine (it affects bit numbering, not byte order). The compiler will not generate code to reorder multi-byte fields when a non-native bit order is specified.[1][2][3]


References[edit]

  1. AI95-00133-01 (1996-05-07). "Controlling bit ordering". Class: binding interpretation. Ada Rapporteur Group. http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ais/ai-00133.txt?rev=1.17. "Bit_Order clauses are concerned with the numbering of bits and not concerned with data flipping interoperability." 
  2. ISO/IEC 8652:2007. "13.5.3 Bit Ordering (9/2)". Ada 2005 Reference Manual. http://www.adaic.com/standards/05rm/html/RM-13-5-3.html#I4589. Retrieved 2008-06-02. "Bit_Order clauses make it possible to write record_representation_clauses that can be ported between machines having different bit ordering. They do not guarantee transparent exchange of data between such machines." 
  3. Thomas Quinot (January 2013). "Gem #140: Bridging the Endianness Gap". AdaCore. http://www.adacore.com/adaanswers/gems/gem-140-bridging-the-endianness-gap/. Retrieved 2013-01-31. "the order in which the bytes that constitute machine scalars are written to memory is not changed by the Bit_Order attribute -- only the indices of bits within machine scalars are changed."