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 X-Google-Thread: 103376,e3feb606f668a7c1 X-Google-Attributes: gid103376,public From: gisle@lunde.ii.uib.no (Gisle S�lensminde) Subject: Re: Why should hackers love Ada. (Re: Ada 95 based RTOS) Date: 2000/02/24 Message-ID: #1/1 X-Deja-AN: 589242259 Content-Transfer-Encoding: 8bit References: <88ilp7$bcm$1@nnrp1.deja.com> <38ADCA44.3B91BF6F@averstar.com> <88qli0$gvr$1@nnrp1.deja.com> <38B2A2A1.FDCDDFE7@honeywell.com> <88ugrd$7j7$1@nnrp1.deja.com> <890ght$bih1@ftp.kvaerner.com> <38B3EA94.E3AB4929@maths.unine.ch> <38B41432.88D7389F@quadruscorp.com> <38B47521.1A80B6A1@lmtas.lmco.com> Organization: University of Bergen, Norway Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-02-24T00:00:00+00:00 List-Id: In article <38B47521.1A80B6A1@lmtas.lmco.com>, Gary wrote: >Hi, > >"Marin D. Condic" wrote: > >> Ehud Lamm wrote: >> > >> In some ways, you'd think "hackers" should be fascinated with Ada. It >> provides all sorts of facilities to do bit-twiddling and low level >> access to the hardware. > >I see this reference to ADA being good at bit twiddling, periodically. >Virtually all high-level languages provide facilities for bit twiddling. Is >there something unique about ADA (I'm a non-ADA programmers, sorry). Is this >a reference to a transfer function (other languages have this) or memory >aliasing tricks? > Because Ada heve some good methods for lowlevel access to hardware, and this includes bit twidling. Some bit operations are: - Bitwise logical operators for modular types, and in the package interfaces there is operators for bitwise shift and rotatate. - Packed arrays of boolean(and other types). Yoy can declare an array of booleans, where each element corresponds to one bit. A 32-bit array of packed booleans fits in one word on a 32-bit computer. - The compiler knows whether the target is a big endian or a little endian architecture, and you have tests to find it out, which can be used in code to make it portible. - Representation clauses in records, so you can control where "the bits goes" in a record. -- Gisle S�lensminde ( gisle@ii.uib.no ) ln -s /dev/null ~/.netscape/cookies