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,2370fc34f084c855 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-02 19:02:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!wn3feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: "SteveD" Newsgroups: comp.lang.ada References: Subject: Re: creating a 16 bit value from 2 8 bit values in Ada (again) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1028340130 12.225.227.101 (Sat, 03 Aug 2002 02:02:10 GMT) NNTP-Posting-Date: Sat, 03 Aug 2002 02:02:10 GMT Organization: AT&T Broadband Date: Sat, 03 Aug 2002 02:02:10 GMT Xref: archiver1.google.com comp.lang.ada:27635 Date: 2002-08-03T02:02:10+00:00 List-Id: Sorry about my previous accidental send. Here is how I would do it (the following compiles and runs on GNAT 3.14p-nt): with Ada.Text_Io; with Interfaces; use Interfaces; procedure Test is function To_Unsigned_16( lsb, msb : Unsigned_8 ) return Unsigned_16 is begin return Shift_Left( Unsigned_16( msb ), 8 ) or Unsigned_16( lsb ); end To_Unsigned_16; begin Ada.Text_Io.Put_Line( Unsigned_16'IMAGE( To_Unsigned_16( 16#01#, 16#00# ) ) ); Ada.Text_Io.Put_Line( Unsigned_16'IMAGE( To_Unsigned_16( 16#00#, 16#01# ) ) ); end Test; SteveD