From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca7e14ee1b312f90 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-26 18:57:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!news.inreach.com!53ab2750!not-for-mail Message-ID: <3EAB3906.7060402@telis.org> From: Rick Stikkers User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Minimum Record Size? LONG References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 26 Apr 2003 18:57:26 -0700 NNTP-Posting-Host: 209.209.66.231 X-Trace: news.inreach.com 1051408624 209.209.66.231 (Sat, 26 Apr 2003 18:57:04 PDT) NNTP-Posting-Date: Sat, 26 Apr 2003 18:57:04 PDT Organization: InReach Internet Xref: archiver1.google.com comp.lang.ada:36626 Date: 2003-04-26T18:57:26-07:00 List-Id: Steve wrote: >Here's an approach taking advantage of using "Slices" of arrays (tested >w/Gnat3.15p-nt): > > > If you're not worried about machine cross compatibility, the other option would be to just give in to the endianness of the machine and swap everything so that the endianness is fully preserved. The following code segment gives the desired results. with TEXT_IO; procedure comp is type six_bits is range 0..2**6-1; for six_bits'SIZE use 6; type four_sixes is record six_bits_0 : six_bits; six_bits_1 : six_bits; six_bits_2 : six_bits; six_bits_3 : six_bits; end record; for four_sixes use record six_bits_0 at 0 range 18..23; six_bits_1 at 0 range 12..17; six_bits_2 at 0 range 6..11; six_bits_3 at 0 range 0..5; end record; for four_sixes'SIZE use 24; type eight_bits is range 0..2**8-1; for eight_bits'SIZE use 8; type three_eights is record eight_bits_0 : eight_bits; eight_bits_1 : eight_bits; eight_bits_2 : eight_bits; end record; for three_eights use record eight_bits_0 at 2 range 0..7; eight_bits_1 at 1 range 0..7; eight_bits_2 at 0 range 0..7; end record; for three_eights'SIZE use 24; six_var : four_sixes; eight_var : three_eights; for eight_var use at six_var'ADDRESS; begin six_var.six_bits_0 := 28; six_var.six_bits_1 := 55; six_var.six_bits_2 := 25; six_var.six_bits_3 := 50; text_io.put_line(eight_bits'IMAGE(eight_var.eight_bits_0)&" "& eight_bits'IMAGE(eight_var.eight_bits_1)&" "& eight_bits'IMAGE(eight_var.eight_bits_2)); end;