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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca15935e4fb21334 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Storage space question Date: 1998/12/10 Message-ID: #1/1 X-Deja-AN: 420972542 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: <36704ADB.73FA308D@pwfl.com> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-12-10T00:00:00+00:00 List-Id: Marin David Condic (condicma@bogon.pwfl.com) wrote: : ... : If you can't find an answer in the compiler-specific documentation, you : can always get there through the : less-desirable-but-no-worse-than-C-does-it method of declaring a bunch : of named numbers: : Some_Name : constant := 2#0101# ; : It does, as you observe, have name-space problems, but it will get you : there. Actually, rather than using named numbers, I would recommend using named constants of a derived integer type devoted to this particular machine register. This way, you would at least get some type checking when you have more than one such machine register. E.g.: type DMA_Register_Command is range 0..2#1111#; Start_DMA_Transfer : constant DMA_Register_Command := 2#0101#; ... Personally, I would only use enumerations for things which are clearly enumerable. Machine registers often use combinations of bits, which are easily done with "+" for integers (or with "or" in Ada 95 on modular types), but not easily done with enumeration types. : MDC : -- : Marin David Condic : Real Time & Embedded Systems, Propulsion Systems Analysis : United Technologies, Pratt & Whitney, Large Military Engines : M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600 : Ph: 561.796.8997 Fx: 561.796.4669 : ***To reply, remove "bogon" from the domain name.*** -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company