Talk:FOE: Difference between revisions

From OHRRPGCE-Wiki
Jump to navigation Jump to search
bit order
Line 7: Line 7:
[[User:Sorlok reaves|S'orlok Reaves]]: I'm aware of little-endian usages in lumps for INTEGERS, I just didn't know the bitsets were reversed too. So, given a byte of bitset data, 08, this translated to to three bits off, one bit on, then four bits off. I verified this, of course... the "chum bug" in WH is the easiest to test.
[[User:Sorlok reaves|S'orlok Reaves]]: I'm aware of little-endian usages in lumps for INTEGERS, I just didn't know the bitsets were reversed too. So, given a byte of bitset data, 08, this translated to to three bits off, one bit on, then four bits off. I verified this, of course... the "chum bug" in WH is the easiest to test.
If I recall, "endian"-ness can ONLY apply to bytes, not bits. Can you point me to a line in the sources that loads bitsets? I'd like to have a look.
If I recall, "endian"-ness can ONLY apply to bytes, not bits. Can you point me to a line in the sources that loads bitsets? I'd like to have a look.
[[User:James Paige|James Paige]]: I have always thought of bits in a little-endian least-signifigant-bit-first way.
1 = 10000000
2 = 01000000
3 = 11000000
4 = 00100000
This is opposite of how most people (and text books) write it.

Revision as of 10:43, 29 July 2007

Mike C.: The reason that the bits appear to be backwards is because the OHR and all platforms it runs on uses Little-Endian byte ordering.

If you have number AB CD, then it lives in memory as CD AB, and is stored on disk the same way. 32-Bit numbers are the same: AB CD EF GH => GH EF CD AB.

Not sure of any particular rationale, but the decision was made decades ago.

S'orlok Reaves: I'm aware of little-endian usages in lumps for INTEGERS, I just didn't know the bitsets were reversed too. So, given a byte of bitset data, 08, this translated to to three bits off, one bit on, then four bits off. I verified this, of course... the "chum bug" in WH is the easiest to test. If I recall, "endian"-ness can ONLY apply to bytes, not bits. Can you point me to a line in the sources that loads bitsets? I'd like to have a look.

James Paige: I have always thought of bits in a little-endian least-signifigant-bit-first way.

1 = 10000000
2 = 01000000
3 = 11000000
4 = 00100000

This is opposite of how most people (and text books) write it.