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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,90212413571e3e8b,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!feeder1.cambrium.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng1.kpn.DE!newsfeed00.sul.t-online.de!newsfeedt0.toon.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Erik Baigar Newsgroups: comp.lang.ada Subject: Endian-problem/bug with system.bit_ops (gnat3.15)... Date: Sat, 15 Mar 2008 08:58:12 +0100 Organization: T-Online Message-ID: <47DB8194.62FE76B0@baigar.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.t-online.com 1205568276 02 3970 bfjEOrbOX2-g3Ud 080315 08:04:36 X-Complaints-To: usenet-abuse@t-online.de X-ID: Z4GKyOZGgeqXuuK0iM1oFJQauB+Z-pnTbiZP4ea4NV0qm+WHppqiUn X-Mailer: Mozilla 4.76C-SGI [en] (X11; I; IRIX 6.5 IP22) X-Accept-Language: en Xref: g2news1.google.com comp.lang.ada:20412 Date: 2008-03-15T08:58:12+01:00 List-Id: Dear Ada users, in porting an application from Meridian's Ada83 to gnat3.15 I encountered some issues with the system.bit_ops. They (especially the Bit_And which I used) show behaviour which depends on the processor used: The code contains expressions of the form Bit_And ( MEMORY (OPERAND_ADDRESS)'Address,18, ACCUMULATOR'Address,18, ACCUMULATOR'Address); which are used in the simulation of a vintage processor. I used length 18 here since the processor has 18-bit registers. This code works well on the Intel (little endian) platform but fails on SPARC (big endian). It required some investigation to locate the problem, but replacing the length 18 by 32 (all are integers here), i.e. using Bit_And ( MEMORY (OPERAND_ADDRESS)'Address,32, ACCUMULATOR'Address,32, ACCUMULATOR'Address); solved the problem and the code now runs on little and big endian systems. I know, system.bit_ops are version dependent and non portable, but I'd not expect behaviour depending on the target system at the first glance... Regards, Erik.