comp.lang.ada
 help / color / mirror / Atom feed
From: agate!spool.mu.edu!sdd.hp.com!cs.utexas.edu!sun-barr!west.West.Sun.COM!cr onkite.Central.Sun.COM!texsun!yorktown!young@ucbvax.Berkeley.EDU  (Mark Young)
Subject: Declaring Arrays of Bits (how)?
Date: 29 Sep 92 16:11:12 GMT	[thread overview]
Message-ID: <YOUNG.92Sep29101112@kuwait.gdfwc3> (raw)

I am trying to declare arrays of bits in Ada.  Here's my attempt:


type Array_Range_Type is range 1..128;

type Bit_Type is (OFF, ON);
for  Bit_Type use (OFF => 0, ON => 1);
for  Bit_Type'size use 1;

type Bit_Array_Type is array (Array_Range_Type) of Bit_Type;

Bit_Array : Bit_Array_Type;


This looks right to me.  I would expect Bit_Array to be represented
as an array of 128 bits (128 contiguous bits).  This is not the case,
however.  My compiler (XDADA) is representing Bit_Array as an array
of 128 bytes.  As an added note, I have been using representation clauses
for records without any problems.  

Am I missing something?  
Is there a special representation clause for arrays that I am overlooking? 
Is my compiler at fault?

Thanks for the INPUT,
Mark Young

             reply	other threads:[~1992-09-29 16:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-09-29 16:11 agate!spool.mu.edu!sdd.hp.com!cs.utexas.edu!sun-barr!west.West.Sun.COM!cr [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-09-29 16:54 Declaring Arrays of Bits (how)? jvnc.net!darwin.sura.net!jhunix.hcf.jhu.edu!aplcen.apl.jhu.edu!ddsdx2.jhu
1992-09-29 17:07 Mark A Biggar
1992-09-29 18:33 Bob Kitzberger
replies disabled

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