comp.lang.ada
 help / color / mirror / Atom feed
* Simple Data Endianness
@ 2020-02-13  9:42 guijarrockguijarro
  2020-02-13 11:10 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: guijarrockguijarro @ 2020-02-13  9:42 UTC (permalink / raw)


Hi, 


The problem I present today is related to the coexistence between big-endian and little-endian application data.

I have found a way that structures (records) are stored in memory according to one criterion or another (big-endian or little-endian).

Assuming that 'Date' is a structure type, I can use the following statements to indicate that I want them to be stored in memory as big-endian:

   for Date'Bit_Order use System.High_Order_First;
   for Date'Scalar_Storage_Order use System.High_Order_First;


My question appears when I have a simple type, such as an enumerated or an integer that occupies more than one byte and I need to instruct the compiler to store it in memory as a big-endian. Like this example:

   type Colour is (BLACK,YELLOW,WHITE,RED);  
   for Colour'SIZE use 32;

Is there any analogous way of doing this as in the case of compound types?


Thank you so much.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-02-15 14:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13  9:42 Simple Data Endianness guijarrockguijarro
2020-02-13 11:10 ` Dmitry A. Kazakov
2020-02-13 15:12   ` Optikos
2020-02-13 15:28     ` Dmitry A. Kazakov
2020-02-13 16:47       ` Optikos
2020-02-13 17:29         ` Dmitry A. Kazakov
2020-02-13 20:36           ` Optikos
2020-02-14  8:20             ` Dmitry A. Kazakov
2020-02-14 17:25               ` Optikos
2020-02-14 20:22                 ` Dmitry A. Kazakov
2020-02-15 14:56                   ` Optikos
2020-02-13 15:44 ` Daniel
2020-02-13 15:57   ` Dmitry A. Kazakov
2020-02-14 16:52 ` Shark8

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox