views:

111

answers:

4

I'm studying 8086 assembly language at high school and I have this question:

For example I have this number ABCD (hex). How is it stored on the memory?

Does the AB go for example to memory address 01 and the CD goes to address 02?

A: 

Depends on the Endianness of the system you're working on.

x86 systems use little endian, so the value ABCD would appear in memory as CD followed by AB

PaulG
A: 

8086 uses little endian format.

Macmade
No Idea what it means sorry :\ I'm still an high-school student and our computer knowledge level is pretty low in compare to university.
Tal
CD - AB. You should read the Wikipedia article about endianness : )
Macmade
+4  A: 

8086 stores the values in little endian format. So the lower order byte (i.e. CD) is stored first and then the higher order byte is stored. So in your case it will be address 01 will have CD and 02 will have AB.

Naveen
Thank you very much!
Tal
A: 

8086 stores data in little endian, which means that it is in reverse order that what you (a human) might expect. That means that a if 16 bit integer, in your case ABCD, would be stored in memory address 0010 it would be like this:

0010: CD
0011: AB

The more significant part is stored before the less significant. Remember it like this: the lower part is stored in the lower address, the higher part is stored in the higher address.

Bob