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,1048aea26a740e29 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Bit operators Date: 2000/02/13 Message-ID: <48np4.505$e6.7474@newsread1.prod.itd.earthlink.net>#1/1 X-Deja-AN: 585156599 Content-transfer-encoding: 7bit References: <884o85$jjv$1@news.fsu.edu> Content-Type: text/plain; charset="US-ASCII" X-ELN-Date: Sat Feb 12 16:44:48 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 950402688 38.26.192.10 (Sat, 12 Feb 2000 16:44:48 PST) Organization: EarthLink Network, Inc. Mime-version: 1.0 NNTP-Posting-Date: Sat, 12 Feb 2000 16:44:48 PST Newsgroups: comp.lang.ada Date: 2000-02-13T00:00:00+00:00 List-Id: In article <884o85$jjv$1@news.fsu.edu> , grant@cs.fsu.edu (Joshua Grant) wrote: > I was recently assigned a project for one of my classes that gave us the > option of implementing a simplified MIPS assempler in any preferred higher > level language. I have choosen ADA, but I am running into a problem with > the bit operators. I can't find them! In case someone isn't sure of my > question. In C++ if you perform an 'and' operation with the '&' > operator like... > > base 10 > 1 = 1 & 3 > 3 = 3 & 3 > 2 = 6 & 3 > 3 = 7 & 3 declare I : Interfaces.Unsigned_32; begin I := 1 and 3; I := 3 and 3; etc end; > base 2 (same as above) > 001 = 001 & 011 > 011 = 011 & 011 > 010 = 110 & 011 > 011 = 111 & 011 declare I : Interfaces.Unsigned_32; begin I := 2#110# and 2#011#; I := 2#111# and 2#011#; etc end; > Can anyone tell me if ADA has an equivalent set of functions for 'and' and > 'or'? If you know please respond ASAP, I need to know if I should rewrite > my project in a language that supports those operations. Ada is a systems programming language, just like C/C++. Anything you can do in C, you can do in Ada. Bitwise operators are predefined for modular types. The operations are named "and" and "or". -- Celebrate Darwin Day on Saturday, 12 February!