|
-
Jul 27th, 2006, 10:35 PM
#1
Thread Starter
Member
[RESOLVED] How is hex 35 01 dec 309?
Hello,
I'm probably just being really dumb, but how can hex 35 01 be decimal 309?
A quick check in Calculator shows hex 35 01 to be 13569, yet when I use a hex editor on a value of "35 01", it shows "35 01 as integer: 309". The actual value I want it to be is 309, so it is correct, but I'm wondering how it reached that answer?
Any advice would be appreciated - maths certainly isn't my strong point
Last edited by j2k; Jul 28th, 2006 at 08:36 PM.
Reason: Added resolved status
-
Jul 28th, 2006, 08:53 AM
#2
Member
Re: How is hex 35 01 dec 309?
0x3501 = 13569 as you said, but 309 = 0x0135.
-
Jul 28th, 2006, 09:28 AM
#3
Re: How is hex 35 01 dec 309?
Just to clear it up a little..
Your hex editor is reading the value as "little endian", basically backwards. Instead of 35 01, it is seeing it as 01 35 (=309)
-
Jul 28th, 2006, 10:03 AM
#4
Thread Starter
Member
Re: How is hex 35 01 dec 309?
Thanks a lot, that makes sense now
-
Aug 9th, 2006, 07:00 AM
#5
Re: [RESOLVED] How is hex 35 01 dec 309?
All intel-based hardware uses little endian storage by default. But when you write numbers on paper it is by definition big endian. Intel does this because its a bit more efficient for the computer to work this way. Some other architectures (RISC for example) use big endian storage which looks a lot more sensible when you hex edit a file.
Swings and roundabouts really.
I don't live here any more.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|