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: Gautier Subject: Re: Bit operators & asm in Ada (novice question) Date: 2000/02/13 Message-ID: <38A6CA94.4DA3C716@maths.unine.ch>#1/1 X-Deja-AN: 585327357 Content-Transfer-Encoding: 7bit References: <884o85$jjv$1@news.fsu.edu> <48np4.505$e6.7474@newsread1.prod.itd.earthlink.net> <38A624B3.5709A464@interact.net.au> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 13 Feb 2000 15:14:11 +0100, mac13-32.unine.ch MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-02-13T00:00:00+00:00 List-Id: So - in Borland C++ I may actually write asm directly into code (not that I can yet), but - is this possible in Ada ? Yes. But you won't need it. Borland's compiler translates the operations into unefficient, redundant machine code that actually need asm rewrite. If you take an optimizing Ada compiler (say GNAT) and compile with "-O2 -gnatp", the code generator will do an impressive optimisation effort, in particular with bitfield manipulations. You can see it in action for drawing 3D polygon scanlines (link below)... > Does the Ada programmer have to construct their programs with a preconceived > notion that it will have to be rewritten in parts in Assembly ? So, fortunately not. Would it be true, they should consider changing their compiler... In addition asm insertions break portability and security (run with range check). Should be used only for 1-asm-instruction procedure to communicate with hardware (IMHO). -- Gautier _____\\________________\_______\_______ http://members.xoom.com/gdemont/e3d.htm