Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the segment:offset addressing scheme work?

I've read that in the days of the Intel 8086 CPU the biggest registers were 16-bits and everyone were looking for a way to access more than 65536 bytes of linear memory but instead of expanding the CPU registers they invented the segment:offset addressing scheme and the way I understand it you're able to "group" two 16-bit registers together into a 32-bit memory address. But the same place I have also read that the CPU could only access 1MB of memory. How does that work? 2^32 equals 4,294,967,296 so I don't understand, please enlighten me :)

like image 896
Benjamin Avatar asked Jan 24 '26 12:01

Benjamin


1 Answers

The segment register value is shifted left by 4 (multiplied by 16) and added to the "offset" part of the address address.

16 * 65536 = 1 megabyte.

like image 67
Hans Passant Avatar answered Jan 26 '26 03:01

Hans Passant