Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!polyslo!jdudeck From: jdudeck@polyslo.CalPoly.EDU (John R. Dudeck) Newsgroups: comp.sys.ibm.pc Subject: Re: SEGMENT:OFFSET Madness Message-ID: <25ae57d5.3be8@polyslo.CalPoly.EDU> Date: 12 Jan 90 22:19:01 GMT References: <25821@cup.portal.com> Reply-To: jdudeck@polyslo.CalPoly.EDU (John R. Dudeck) Organization: Cal Poly State University -- San Luis Obispo Lines: 28 In article <25821@cup.portal.com> cliffhanger@cup.portal.com (Cliff C Heyer) writes: >Perhaps an astute observer could offer and explanation >that would more easily allow conceptualization of what >the current "segment:offset" really represent. I share your frustration with trying to understand the 80x86 architecture. A lot of why it is this way has to do with the wonders of evolution... Mentally I think of the offset as being exactly what it sounds like, the displacement into the segment starting from some base address. And a segment can be visualized as a 64k "window" into the address space of the memory. The starting address of that window is the value in the segment register being used. Since segment registers are only 16 bits long, and since the address space is 20 bits wide (in "real" mode), the segment register just contains the 16 most significant bits of the base address of the "window", and the 4 lsb's are always 0, resulting in the situation that segments are aligned on 16-byte boundaries. Of course when you go into "protected" mode, or to the 386, the picture changes again... Really, I don't see too much point in bashing the design decisions made by the designers. Every cpu ever designed is a combination of tradeoff decisions. I do feel it was too bad that IBM chose the 8088 for the PC. The National Semiconductor 16016 would have been a much better choice... or the 32032 even better yet! -- John Dudeck "You want to read the code closely..." jdudeck@Polyslo.CalPoly.Edu -- C. Staley, in OS course, teaching ESL: 62013975 Tel: 805-545-9549 Tanenbaum's MINIX operating system.