From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 25 May 93 14:12:35 GMT From: dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!zaphod.mps.o hio-state.edu!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mksol!mkserv!ddessert@u cbvax.Berkeley.EDU (Dave Dessert) Subject: Packed BIT fields -- any help?? Message-ID: <1993May25.141235.14712@mksol.dseg.ti.com> List-Id: I've run up against an "age-old" problem and hope that maybe someone can shed some light on a "simple" solution. We are trying to pass data memory-to-memory between two machines - a Sun SPARC using SunAda (Verdix) and a TI TMX320C30 using Tartan Ada. Much of the data is packed into bit fields. The problem is that the two comilers have chosen opposite orders for bit numbering -- Tartan uses LSB = 0, Verdix uses MSB = 0. We would like to use the same source code for defining types on both machines be have been unable to invent a method for specifying the bits (using constants , etc) that will compile to the same pattern on both machines. Using "pragma PACK" do esn't help either -- the compilers re-arrange and pack differently, too. We can't be the first folks to run up against this -- has anybody already got an elegant (or, at least, workable) way to avoid maintaining two sets of source code, or two sets of type names??