I know big endian in 32 bit is 4321. Is little endian 3412? Im doing some graphic stuff, so now I actually need to care about the bytes. Cant treat everything like a 32-bit int anymore.
It doesnt matter how internaly in memory data is stored, when you do something with it, it is loaded into register and there everything is on the right place.
While this is true, I dont agree on dismissing the need to understand this. To answer your question its best illustrated by example (I only blabber otherwise ;) )
BTW: DPrintValH is a macro Ernie has on is web site for debugging. The output is: >: 00003400H >: 00003300H >: 00003200H >: 00003100H So, WRITE to memory eax =(ABCD) will store memory as (DCBA). And, READ from memory (ABCD) will have eax == (DCBA) in its register. Hope this helps. NaN
mov eax, '1234' mov DATA, eax lea eax, DATA mov ecx, 0 mov ch, DPrintValH ecx, ">" mov ch, DPrintValH ecx, ">" mov ch, DPrintValH ecx, ">" mov ch, DPrintValH ecx, ">"
Just what I thought. The registers ARE backwards from memory. Or is it the other way around?:)
It's not the registers that are backwards. Registers always hold bits in the correct order. It's the memory that's backwards, and in the case of byte-addressable machines like the x86, it's per byte. And, furthermore, it's backwards only from the viewpoint of a typical memory dump.