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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4ac6504560f5ef27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-27 12:38:46 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!teaser.fr!wanadoo.fr!not-for-mail From: Guillaume Foliard Newsgroups: comp.lang.ada Subject: Re: Little Endian -> Big Endian (Ada95 / GNAT) Date: Fri, 27 Feb 2004 21:38:57 +0100 Organization: Old Europe Message-ID: References: NNTP-Posting-Host: aboulogne-102-1-6-20.w81-50.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news-reader2.wanadoo.fr 1077914325 2907 81.50.42.20 (27 Feb 2004 20:38:45 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 27 Feb 2004 20:38:45 GMT User-Agent: KNode/0.7.6 Xref: archiver1.google.com comp.lang.ada:5909 Date: 2004-02-27T20:38:45+00:00 List-Id: Hi, On a x86 with GNAT, a slightly modified version would look like : with Interfaces; with System.Machine_Code; use System.Machine_Code; function To_Big_Endian (N : Interfaces.Unsigned_32) return Interfaces.Unsigned_32 is Result : Integer; begin Asm ("bswap %0", Inputs => Integer'Asm_Input ("a", N), Outputs => Integer'Asm_Output ("=a", Result)); return Result; end To_Big_Endian;