0x10 0x20 means 0x1020 or 0x2010 ?

how it is for motorola 68000 and intel .....
does a motorola networking byte order?


BTW :there are 6502 threads on the main topic just now ;)
Posted on 2003-11-23 11:05:41 by HarryTuttle
The question of "endian-ness"!

Intel is little endian, this means the least significant byte is first in memory.
0xAABBCCDD = 0xDD, 0xCC, 0xBB, 0xAA.

68k processors are big endian, meaning the most significant byte is written first.
0xAABBCCDD = 0xAA, 0xBB, 0xCC, 0xDD.

To swap the byte order on a 32 bit number on x86 use BSWAP (.486 processor and above).
To swap 16 bit numbers use "rol reg, 8".

Mirno
Posted on 2003-11-23 13:36:29 by Mirno
:) nice answer! I was going to ask you about how to swap ....
Posted on 2003-11-24 09:38:02 by HarryTuttle
Hi Harry,

The 6502 was little endian also, IIRC ;) . JSR F800 20 00 F8

Charles
Posted on 2003-11-28 16:21:17 by cdquarles
the Intel way has one advantage: you can access the same memory address to read different data sizes:
if your memory contains 0xAABBCCDD

you can access one byte and get 0xDD
if you access one word you get 0xCCDD
and dword 0xAABBCCDD

I have currently no example in mind, but sometimes this is useful...

Disadvantage: you cannot read dwords in hexdump the right way: "RIFF" will become "FFIR" after reading into eax :)

What I ask myself is, will QWORDs be stored also Intel like? Least significant DWORD first, higher last?
Posted on 2003-11-28 16:50:55 by beaster
i'd say... sure
you could have asked the same question when going from 16bits to 32bits - Least significant word first, higher last? - the answer was yes. i'm quite sure they'll keep the system as it was, it wouldn't make much sense if they didn't.
Posted on 2003-11-29 05:15:44 by hartyl