Title: Byte Addressability
1Byte Addressability
- Bytes are always 8 bits
- Word length typically ranges from 16 to 64 bits.
- Memory location assignments refer to successive
byte locations in memory - Memory is byte-accessible.
- For 8086, a Word is 16-bits (2 bytes)
2Word Length
- For the 8086, a Word is 16-bits (2 bytes)
A Signed Integer A Signed Integer A Signed Integer A Signed Integer A Signed Integer A Signed Integer A Signed Integer A Signed Integer
b15 b14 b1 b0
lt------------------------------16 bits -----------------------------gt lt------------------------------16 bits -----------------------------gt lt------------------------------16 bits -----------------------------gt lt------------------------------16 bits -----------------------------gt lt------------------------------16 bits -----------------------------gt lt------------------------------16 bits -----------------------------gt lt------------------------------16 bits -----------------------------gt lt------------------------------16 bits -----------------------------gt
2 Characters 2 Characters 2 Characters 2 Characters 2 Characters 2 Characters 2 Characters 2 Characters
8 bits 8 bits 8 bits 8 bits 8 bits 8 bits 8 bits 8 bits
lt----- ASCII character -----gt lt----- ASCII character -----gt lt----- ASCII character -----gt lt----- ASCII character -----gt lt----- ASCII character -----gt lt----- ASCII character -----gt lt----- ASCII character -----gt lt----- ASCII character -----gt
3Little-Endian Formatting
- There are two ways that byte addresses can be
assigned across words. - Big-Endian higher byte addresses are used for
the less significant bytes of a word - Little-Endian lower byte addresses are used for
the less significant bytes of a word - The Intel Architecture uses Little Endian
4Little-Endian Assignments
- .data
- List BYTE 10, 20, 30, 40, 50, 60
Offset Value
0005 60
0004 50
0003 40
0002 30
0001 20
0000 10
note that with byte size data, there is no
difference between Big-Endian and Little-Endian
5Big-Endian Assignments
- .data
- List BYTE 10, 20, 30, 40, 50, 60
Offset Value
0005 60
0004 50
0003 40
0002 30
0001 20
0000 10
note that with byte size data, there is no
difference between Big-Endian and Little-Endian
6Little-Endian Assignments
- .data
- List WORD 1020h, 3040h, 5060h
Offset Value
0005 50
0004 60
0003 30
0002 40
0001 10
0000 20
note that with word size data, the low-order
byte is stored in a lower address
7Big-Endian Assignments
- .data
- List WORD 1020h, 3040h, 5060h
Offset Value
0005 60
0004 50
0003 40
0002 30
0001 20
0000 10
note that with word size data, the low-order
byte is stored in a higher address
8Little-Endian Assignments
- .data
- List DWORD 10203040h, 50607080h
Offset Value
0005 70
0004 80
0003 10
0002 20
0001 30
0000 40
note that with word size data, the low-order
byte is stored in a lower address
9Big-Endian Assignments
- .data
- List DWORD 10203040h, 50607080h
Offset Value
0005 60
0004 50
0003 40
0002 30
0001 20
0000 10
note that with word size data, the low-order
byte is stored in a higher address
10Big-Endian Assignments
- .data
- List DWORD 00000006h
Offset Value
0005 XX
0004 XX
0003 06
0002 00
0001 00
0000 00
note that with word size data, the low-order
byte is stored in a higher address
11Little-Endian Assignments
- .data
- List DWORD 00000006h
Offset Value
0005 XX
0004 XX
0003 00
0002 00
0001 00
0000 06
note that with word size data, the low-order
byte is stored in a higher address
12Big-Endian Assignments
- .data
- List BYTE This is a string,0
Offset Value
0005 73
0004 20
0003 73
0002 69
0001 68
0000 54
note These are the ASCII values T54H,
h68H, i 69H
13Little-Endian Assignments
- .data
- List BYTE This is a string,0
Offset Value
0005 73
0004 20
0003 73
0002 69
0001 68
0000 54
note Strings are saved as byte data