comp.lang.ada
 help / color / mirror / Atom feed
From: bashford@srs.loral.com (Dave Bashford)
Subject: How does Alsys index bit-arrays on Intel ?
Date: Fri, 19 Mar 1993 19:34:43 GMT
Date: 1993-03-19T19:34:43+00:00	[thread overview]
Message-ID: <1993Mar19.193443.524@scf.loral.com> (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)



             reply	other threads:[~1993-03-19 19:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-03-19 19:34 Dave Bashford [this message]
1993-03-22 19:16 ` How does Alsys index bit-arrays on Intel ? 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
replies disabled

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