68k endianess question
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
68k endianess question
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?
Thanks
Thanks
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
I just changed my flashing code when I found out that upper and lower bytes were swapped on my flashcart
00 should be on 0 (D0 to D7), and E0 should be on 1 (D8 to D15)... I think, I may be wrong...
EDIT, no, the other way....
00 should be on 0 (D0 to D7), and E0 should be on 1 (D8 to D15)... I think, I may be wrong...
EDIT, no, the other way....
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
I think so... 00E0 looks like 00E0 to 68K, while it would look like E000 to x86 or other little-endian things...
If the ROM won't work, you know you got things the wrong way
If the ROM won't work, you know you got things the wrong way
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 745
- Joined: Sat Dec 15, 2007 7:49 am
- Location: Kazakhstan, Pavlodar
Confirm. So if memory has at some addr (i.e. $000000) 11 22 33 44, it will be: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.
Code: Select all
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.
Last edited by HardWareMan on Wed Feb 04, 2009 6:52 am, edited 1 time in total.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm