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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,ce2598d1b5ccf8c8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-18 00:50:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!arclight.uoregon.edu!newsfeed!btnet-peer0!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: crc and Ada Date: Sun, 18 May 2003 07:49:02 +0000 (UTC) Organization: BT Openworld Message-ID: References: NNTP-Posting-Host: host213-123-150-150.in-addr.btopenworld.com X-Trace: titan.btinternet.com 1053244142 21660 213.123.150.150 (18 May 2003 07:49:02 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Sun, 18 May 2003 07:49:02 +0000 (UTC) X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: archiver1.google.com comp.lang.ada:37465 Date: 2003-05-18T07:49:02+00:00 List-Id: "Bart�omiej �." wrote in message news:slrnbcec3j.rh.swierczu@staticline881.toya.net.pl... > Hello, > I'm starting in Ada, and I can't use same operators (like xor, and) in > my programs. I need to count crc. In Java I was writting: > #v+ > ... > crc=(crctable[((crc>>8)^bufor[start+i++]) & 0xFF]^(crc<<8))&0xFFFF; > ... > #v- > What I should use instand of 'xor' and 'and' oparator (becouse in Ada > they are logical oparator, not binary). For example, I replace crc<<8 by > crc*256, and crc>>8 crc/256, but what about xor? You should check out 'modular types' and the standard package 'Interfaces'. What compiler are you using? If the typical GNAT/AdaGIDE combo these can be found under the Help->Language RM drop-down menu. Also, check out www.adapower.com and the 'Learn Ada' option will take you to link to a few free Ada95 books. Good luck!