assembling a signed integer from bytes

Discussion in 'Perl Misc' started by Steve, Jan 8, 2005.

  1. Steve

    Steve Guest

    Hi all

    I am reading data from a serial device with perl, capturing each group
    as an array of numbers generated from the ord of each character. I
    don't know exactly how it is formatted, but having looked at the way
    the values vary and knowing the type of data being transmitted, it
    seems likely that I have several signed numbers each compsed of two of
    my bytes.

    How do I assemble two variables, each carrying a number 0-255 into a
    single, two-byte signed number?

    Thanks

    Simon
    Steve, Jan 8, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rogue Chameleon
    Replies:
    6
    Views:
    342
  2. Malte

    jar assembling tool ...?

    Malte, Apr 23, 2005, in forum: Java
    Replies:
    9
    Views:
    768
    JScoobyCed
    Apr 25, 2005
  3. Replies:
    14
    Views:
    2,072
    CBFalconer
    Jun 18, 2005
  4. Tim Rentsch
    Replies:
    0
    Views:
    457
    Tim Rentsch
    Mar 19, 2011
  5. w wg
    Replies:
    7
    Views:
    201
Loading...

Share This Page