Byte order in memory after storing a 16-bit number on 8086?
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 stor开发者_StackOverflow中文版ed on the memory?
Does the AB go for example to memory address 01 and the CD goes to address 02?
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.
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
8086 uses little endian format.
精彩评论