Valhalla Legends Forums Archive | General Programming | Copy Memory

AuthorMessageTime
Nub_1
I'v been seeing the CopyMemory() a lot resently in source code, and I don't understand exactly what it's point is. can anyone tell me what exactly the point of CopyMemory is?
November 21, 2003, 2:32 AM
St0rm.iD
Battle.net's binary interface uses little-endian numbers, and so does Intel's CPU. By copying the representation of the integer into a buffer, you effectively get it in little-endian with no work.
November 21, 2003, 2:44 AM
Nub_1
Little-endian numbers? what are those?
November 21, 2003, 3:01 AM
iago
1, in four bytes, looks like this:
Little-endian:
01 00 00 00
Big-endian
00 00 00 01

256 (0x100) in 4 bytes
Little-endian
00 01 00 00
Big-endian
00 00 01 00

123456 (0x1e240) in 4 bytes:
Little-endian:
40 e2 01 00
Bit-endian:
00 01 e2 40


There's good reasons for using little-endian, even though it's counter-intuitive, but they are irrelevant here.

Copy memory is just what it says, it copies memory from one place to another.
November 21, 2003, 3:57 AM

Search