comp.lang.ada
 help / color / mirror / Atom feed
From: mcc@entropy.cs.princeton.edu (Martin C. Carlisle)
Subject: Re: Newbie question : types , representation
Date: 1999/08/23
Date: 1999-08-23T00:00:00+00:00	[thread overview]
Message-ID: <7prl4t$22$1@cnn.Princeton.EDU> (raw)
In-Reply-To: XFMail.990822164551.wilhelm.spickermann@t-online.de

You need to be very careful with the below.  This works fine if, like
Cohen, you are ONLY interested in these two representations.  I just
implemented a Base-64 converter this weekend, and I found the bit order
on Win 98 to be frustrating, and GNAT didn't support changing it (or
else I was doing it wrong).  The modular type worked best for me.
Here's what the bits looked like:

yyxxxxxx zzzzyyyy wwwwwwzz

Note the six bits making up y and z aren't even contiguous.

--Martin

In article <XFMail.990822164551.wilhelm.spickermann@t-online.de>,
Wilhelm Spickermann  <wilhelm.spickermann@t-online.de> wrote:
>The second problem may be solveable using the following parts
>(look into Cohen: Ada as a second language, 2nd Ed.; Part 19.4.5
>where he solved the problem of working with Microsofts FAT12 (12 Bit
>numbers in a packed array))
>
>type Char_64_Array is array (Sometype) of Char_64;
>type Packed_Char_64_Array is new Char_64_Array;
>for Packed_Char_64_Array'Component_Size use 6;
>pragma Pack (Packed_Char_64_Array);
-- 
Martin C. Carlisle, Asst Prof of Computer Science, US Air Force Academy
carlislem@acm.org, http://www.usafa.af.mil/dfcs/bios/carlisle.html
DISCLAIMER:  This content in no way reflects the opinions, standards or 
policy of the US Air Force Academy or the United States Government.




  reply	other threads:[~1999-08-23  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-22  0:00 Newbie question : types , representation Jos De Laender
1999-08-22  0:00 ` Wilhelm Spickermann
1999-08-23  0:00   ` Martin C. Carlisle [this message]
1999-08-23  0:00   ` Simon Wright
1999-08-22  0:00 ` Robert Dewar
1999-08-23  0:00   ` Wolfgang Jeltsch
1999-08-24  0:00     ` tmoran
1999-08-24  0:00   ` jdla
1999-08-24  0:00     ` Matthew Heaney
1999-08-24  0:00       ` Jos De Laender
1999-08-24  0:00         ` Brian Rogoff
1999-08-25  0:00           ` Jos De Laender
1999-08-22  0:00 ` Martin Dowie
     [not found] ` <37C621F3.C6C0DC3A@acenet.com.au>
1999-08-27  0:00   ` tmoran
1999-08-27  0:00     ` Florian Weimer
1999-08-27  0:00   ` David C. Hoos, Sr.
replies disabled

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