comp.lang.ada
 help / color / mirror / Atom feed
* Packed BIT fields -- any help??
@ 1993-05-25 14:12 dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!zaphod.mps.o
  0 siblings, 0 replies; 2+ messages in thread
From: dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!zaphod.mps.o @ 1993-05-25 14:12 UTC (permalink / raw)


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??

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

* Re: Packed BIT fields -- any help??
@ 1993-05-25 22:44 Dave Bashford
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Bashford @ 1993-05-25 22:44 UTC (permalink / raw)


In article <1993May25.141235.14712@mksol.dseg.ti.com> ddessert@dseg.ti.com writ
es:
>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 i
s
>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 constant
s, etc)
>that will compile to the same pattern on both machines.  Using "pragma PACK" d
oesn'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 sourc
e
>code, or two sets of type names??
>

I asked this same question several months ago and will send you what I
got if you'll send me your address (ddesert@lobby.ti.com and
ddessert@dseg.ti.com failed).
-- 

db
bashford@srs.loral.com (Dave Bashford, Sunnyvale, CA)

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

end of thread, other threads:[~1993-05-25 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-05-25 22:44 Packed BIT fields -- any help?? Dave Bashford
  -- strict thread matches above, loose matches on Subject: below --
1993-05-25 14:12 dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!zaphod.mps.o

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