When I want to program the word #$00E0 (appearing like that in a HEX editor) into a memory, at address 0, to be read by the 68k, where does the byte #$00 goes to? d15-d8 or d7-d0?
Chilly Willy wrote:The 68000 is big endian. The value in a register 0x11223344 would be 0x11 0x22 0x33 0x44 in memory seen as bytes in a row from low address to high.
Confirm. So if memory has at some addr (i.e. $000000) 11 22 33 44, it will be:
move.b $000000,d0 * d0 = $xxxxxx11
move.b $000001,d1 * d1 = $xxxxxx22
move.b $000002,d2 * d2 = $xxxxxx33
move.b $000003,d3 * d3 = $xxxxxx44
move.w $000000,d0 * d0 = $xxxx1122
move.w $000002,d1 * d1 = $xxxx3344
move.l $000000,d0 * d0 = $11223344
xx means unchanged previous value
word and longword access must be only at even address, or it will generate Address Error exception.
And write to memory is similar with read from it.
Last edited by HardWareMan on Wed Feb 04, 2009 6:52 am, edited 1 time in total.
Exactamundo! Big-endian data in a nutshell. The SH2 used by the 32X is also big-endian. Funny enough, the Z80 is not. 16 bit values used by the Z80 are little-endian. That's because the Z80 is based on Intel's 8080 line of CPUs, and all Intel CPUs are little-endian.