assembling a signed integer from bytes

S

Steve

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top