HP3000-L Archives

September 1997, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bob Brown <[log in to unmask]>
Reply To:
Bob Brown <[log in to unmask]>
Date:
Thu, 11 Sep 1997 09:23:31 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (45 lines)
     Hmmm, I wrote something like this a few years back, when we got a tape
     (written on a VAX) that contained binary data.  The routine would work
     on a field by field basis; ie, you pass it a field as string (ok,
     character; I wrote it in fortran; I *like* fortran), and it would pass
     it back as HP readable.  I don't remember all the details (old age
     will do that to you; just wait), but the name included "RBN", for
     Reverse Binary Notation. :-)

     -Bob
     [log in to unmask]


______________________________ Reply Separator _________________________________
Subject: Endian Swapping (was: swab the bytes!)
Author:  Jeff Woods <[log in to unmask]> at Internet
Date:    8/22/97 7:16 PM


On Fri, 22 Aug 1997 16:58:10 -0400, Gregory Stigers wrote:
|        ... to see if we can force the code on the PC to write binary
|data as big endian. Ideas, anyone?

I presume that you are talking about numbers (integers) in binary form
which may be interspersed with ASCII data in records to be sent to the
3000.  If it's more than that, then I'm missing something fundamental
probably.  Otherwise, it should be a straightforward matter to write
a routine which knows what fields in a record to swap and swaps them
about.  With a little work it could even be done for multiple record
layouts with a single routine which uses a table of offsets and lengths
to know what to swap for any of a large set of structures.  However, the
quick and easy solution would be to have a separate routine for each
record layout.  Calling this once before writing out the record would
do what you need.  In fact, the very same routine executed on the
Big-Endian data would convert it *back* to Little-Endian.  Hopefully,
there aren't too many places in the code where you write out data to be
read on the 3000.
--
Jeff Woods
[log in to unmask] at Unison Software
[log in to unmask]   at home  [PGP key available here via finger]

"I knew I was alone in a way that no earthling has ever been before."
   --  Michael Collins, on orbiting the moon in the Apollo 11 command module
       while Neil Armstrong and Buzz Aldrin were on the lunar surface

ATOM RSS1 RSS2