Tal
Tal

Reputation: 303

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 stored on the memory?

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

Upvotes: 5

Views: 4973

Answers (3)

Macmade
Macmade

Reputation: 53930

8086 uses little endian format.

Upvotes: 1

Naveen
Naveen

Reputation: 73433

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.

Upvotes: 10

PaulG
PaulG

Reputation: 14021

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

Upvotes: 2

Related Questions