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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,43ad9ab56ebde91c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.213.71 with SMTP id nq7mr4982472pbc.2.1323956296455; Thu, 15 Dec 2011 05:38:16 -0800 (PST) Path: lh20ni25408pbb.0!nntp.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news.mb-net.net!open-news-network.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Does Ada support endiannes? Date: Thu, 15 Dec 2011 14:37:54 +0100 Organization: cbb software GmbH Message-ID: <1iewajwb4t87p.1oltp4lr73tg3.dlg@40tude.net> References: <23835087-313f-427c-b37e-4ff1bdef9d57@r6g2000yqr.googlegroups.com> <108d5437-ae36-4e79-ad4e-aab3b903d0f4@gl2g2000vbb.googlegroups.com> <2f9744b6-4a45-4dd1-9621-c6f5d10166cb@r6g2000yqr.googlegroups.com> <0a7b55fd-1ecf-4a40-979c-12ce44071be9@p9g2000vbb.googlegroups.com> <6779f55b-e110-4673-b70b-cbd7c58f5d78@j10g2000vbe.googlegroups.com> <71bc4e7f-7c23-4180-9a8d-5c880a16d0c2@p16g2000yqd.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-12-15T14:37:54+01:00 List-Id: On Thu, 15 Dec 2011 03:27:48 -0800 (PST), Gerd wrote: > Could you please explain: What do you think how the data send from 68k > to x86 will be converted from one data layout to the other? Assuming 68k is big endian, two's complement: type Octet is new Unsigned_8; function From_Motorola (First, Second : Octet) return Integer_16 is begin if First > 127 then return -1 - Integer_16 (not First) * 256 - Integer_16 (not Second); else return Integer_16 (First) * 256 + Integer_16 (Second); end if; end From_Motorola; Note that the code is target machine's endianness agnostic. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de