← 🧩 Instruction Formats & Addressing Modes
Subtopic 7 of 8

1.7Endianness

The idea

Endianness is the order in which the bytes of a multi-byte number are stored in memory.

Think of it like this: Writing a date as DD/MM/YYYY or YYYY/MM/DD. Same information, different order.

Why it exists

Memory is a row of single bytes, but numbers are several bytes wide, so a convention is needed. Mixing conventions garbles data between machines.

How it works

  1. Big-endian: most significant byte at the lowest address.
  2. Little-endian: least significant byte at the lowest address (x86).
  3. The number is the same; only the layout in memory differs.

Worked example: 0x12345678 stored at address 1000

Big-endian: 1000 → 12, 1001 → 34, 1002 → 56, 1003 → 78. Little-endian: 1000 → 78, 1001 → 56, 1002 → 34, 1003 → 12.

Now play with it

  • →Type another hex value and see both layouts. The gold byte is the most significant one.
Big-endian: MSB at the lowest address
12
addr 1000
34
addr 1001
56
addr 1002
78
addr 1003
Little-endian: LSB at the lowest address (x86)
78
addr 1000
56
addr 1001
34
addr 1002
12
addr 1003

Highlighted byte is the most significant byte (0x12).

Check yourself

Little-endian, 0x12345678 stored at address 1000. Which byte is at address 1000?

Remember: Little = little end first.
Exam notes (the dense version)

Big-endian: MSB at lowest address. Little-endian: LSB at lowest address (x86).

Previous year questions: Instruction Formats & Addressing Modes (12)

PYQs are grouped by topic, so this is the full set for Instruction Formats & Addressing Modes; try the ones that match this subtopic. Open all 12 on the topic page.