From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 19 Sep 92 03:04:03 GMT From: portal!cup.portal.com!R_Tim_Coslet@uunet.uu.net Subject: Re: 32-Bit Unsigned Values - How do I declare them? Message-ID: <66156@cup.portal.com> List-Id: In article: young@gdfwc3 (Mark Young) wrote... >I am trying to declare a 32-bit unsigned integer type to use for addressing ph y >sical devices in an >embedded application (Ada application on an MC68040 VMEbus system). The probl e > >This was my attempt to declare this addressing type: > >type Unsigned_Long_Word is range 0 .. 4294967295; -- 0 to 2^32 >for Unsigned_Long_Word'size use 32; > [deleted text] > >SOMETHING_I_WANT_TO_ADDRESS : ITS_TYPE; > >for SOMETHING_I_WANT_TO_ADDRESS use at To_Address ( (MSW => 16#FFFF#,LSW => 16 # >2000#)); > >This works but I hate it. It places SOMETHING_I_WANT_TO_ADDRESS at address FF F >F2000; > >The main reason I hate it is that I just want to use on value for an address. >Having to split >all addresses into two parts is a major pain in the neck not to mention very u g >ly. > >Does anyone have a better fix to my problem? Yes. First use SYSTEM.ADDRESS type, don't creat your own address integer type! Second declare address values using negative numbers for the ones in the "upper half". For example your address 16#FFFF2000# above should be assigned to a named number, and the named number used in the code. Named numbers should always be used for any implementation dependant qunatities!!! ADDRESS_OF_SOMETHING_I_WANT : constant := -16#10000# + 16#2000#; for SOMETHING_I_WANT_TO_ADDRESS use at ADDRESS_OF_SOMETHING_I_WANT; Now, isn't that MUCH better? R. Tim Coslet Usenet: R_Tim_Coslet@cup.portal.com technology, n. domesticated natural phenomena