From: Bert Nelsen on
Hello,
in an external viewer I can easily add 2 hex values by selecting both,
and I was astonished by the result.

For example I select

"Hex:20" and "Hex:03"
(which would be "Hex:20,Dec:32" and "Hex:03,Dec:3")

The result is "800" in the external viewer, and it's the result I needed.
It concenates the two hex values this way: "03" & "20", then calcuates
the long value from "0320".

Why?
I mean, I thought that it would be "20" & "03", but obviously this isn't
the case.

Can somebody tell me why this has to be done in reverse order?



From: Bill McCarthy on
Look for terms BigEndian and littleEndian.
e.g:
http://en.wikipedia.org/wiki/Big_Endian


"Bert Nelsen" <bert.nelsen(a)googlemail.com> wrote in message
news:eF5rTHF1IHA.4164(a)TK2MSFTNGP03.phx.gbl...
> Hello,
> in an external viewer I can easily add 2 hex values by selecting both, and
> I was astonished by the result.
>
> For example I select
>
> "Hex:20" and "Hex:03"
> (which would be "Hex:20,Dec:32" and "Hex:03,Dec:3")
>
> The result is "800" in the external viewer, and it's the result I needed.
> It concenates the two hex values this way: "03" & "20", then calcuates the
> long value from "0320".
>
> Why?
> I mean, I thought that it would be "20" & "03", but obviously this isn't
> the case.
>
> Can somebody tell me why this has to be done in reverse order?
>
>
>

From: Bert Nelsen on
Bill McCarthy wrote:
> Look for terms BigEndian and littleEndian.
> e.g:
> http://en.wikipedia.org/wiki/Big_Endian

Too lazy to do so... I'll just take it as "god-given".
From: mayayana on

> > Look for terms BigEndian and littleEndian.
> > e.g:
> > http://en.wikipedia.org/wiki/Big_Endian
>
> Too lazy to do so... I'll just take it as "god-given".

Don't let me get you up from the TV, but for the
sake of anyone else who might be curious enough
to struggle through reading a few more sentences:

On Windows numbers are generally stored in
"reverse" when binary data represents numeric
values. (As opposed to the "Motorola" storage
pattern used on Macs.) The first byte is the
lowest. So in a stored integer, the left byte is
(bytevalue x 1). The second byte is (bytevalue x 256).
20 03 is (32 x 1) + (3 x 256).





From: Bert Nelsen on
I rarely set in front of the PC! "Lazy" was meant in a pragmatical way.