comp.lang.ada
 help / color / mirror / Atom feed
* How does Alsys index bit-arrays on Intel ?
@ 1993-03-19 19:34 Dave Bashford
  1993-03-22 19:16 ` john r strohm
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Bashford @ 1993-03-19 19:34 UTC (permalink / raw)


Can anyone tell me definitively whether a packed array of bits is indexed
with the least-significant index in the most- or least-significant bit of
each byte on an Intel-targeted Alsys Ada compiler ?

least-significant index in the least-significant bit:
	7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,23,22,...
or least-significant index in the most-significant bit:
	0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,...

In other words, will the following program print 32768 or 256 or ?

-----------------------------------------------------------------------------
with text_io; with unchecked_conversion;
procedure tst is
	type Bits is range 0..1;
	type Streams is array( natural range 0..15) of Bits;
	pragma pack( Streams );
	type Word is range 0..65535;
	 for Word'size use 16;
	function Word_Of is new unchecked_conversion( Streams, Word );
	Stream: Streams := Streams'(0 => 1, others => 0);
begin
	text_io.put_line( Word'image(Word_Of(Stream)));
end tst;
-----------------------------------------------------------------------------

thanks,

	p.s. a follow-up and summary of the data-interoperability problem
	I asked about last week is coming. It keeps getting weirder and ...
-- 

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



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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-03-19 19:34 How does Alsys index bit-arrays on Intel ? Dave Bashford
1993-03-22 19:16 ` john r strohm
1993-03-23  2:39   ` Robert Kitzberger
1993-03-23 15:29     ` Norman H. Cohen
1993-03-23 20:27       ` john r strohm
1993-03-25 22:09         ` Dave Bashford

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