Live data from Hacker News

8086 Segmented Memory was a good idea

owl.billpg.com

141–150 of 150 posts

Re: 8086 Segmented Memory was a good idea

#141

No No, it wasn't It's the "great idea" that sounds great 5 min in and horrible 10min afterwards You know, kinda like using null as a string end character But more importantly it kept the x86 world for too long in that dead end that was 8086 mode programming "Oh if developers would just..." They won't. They haven't. And they will not ever. In hindsight maybe a binary level translator from 8080 to 8086 would have worke…

Don't know why you're being voted down - you're correct - segmented memory was an awful nasty complex way to program and the industry was eager to see the backside of it. Why would someone be popping up in 2026 saying it was awesome? Weird.

It was awesome in the sense that it was a really, really good solution to the problem they had when the 8086 was being designed:

  * we want to stay 16-bit
  * we want to make porting extremely easy
  * we want to make gradual upgrading of people's programs to >64K easy
  * we want to work well with really small memories (so don't force people to use fat pointers all the time)
  * we don't want the typical (or max non-redundant) instruction to get too long
  * we don't want an MMU
  * we don't want complicated bank switching
  * we don't want long carry chains for all address generations
  * -- but we still want a gigantic address space (for the time it was designed)!

Re: 8086 Segmented Memory was a good idea

#142
post #64

Earlier quoted context omitted.

I was under the impression that the permissions only kicked in once you were in 32-bit mode on the 386, what Windows called "386 Enhanced" mode.

Any protected mode (if enabled). It was introduced with the 286. The operating system/DOS extender could choose to let tasks (programs) run with the highest privileges, which would turn off some of the checks but not all of them -- you still needed valid selectors into valid slots in the descriptor tables.

If I'm not mistaken 286's protected mode wasn't really that popular because it breaks real mode DOS programs. Meanwhile, 386's 32-bit protected mode with paging and virtual 8086 mode was a big success.

Re: 8086 Segmented Memory was a good idea

#143

Earlier quoted context omitted.

Flat memory was a better idea but it wasn't a cheaper idea, and cheaper beats good. A casual Googling shows a price of $2,880 for a IBM PC in ~1982 dollars versus $8,900 for a Sun Microsystems Sun-1 with a MC68000.

That was just Sun's market segment. Also from a casual Google, an IBM PC launched in 1985 (picking the XT 5160-078 as an example) was around $4,995 at launch. Compare that to two 68000-based computers also launched in 1985: the Amiga 1000 launched at $1,295 and the Atari 520ST launched at $600. These computer system prices - Sun, IBM, Commodore, Atari - came from the market segments the manufacturers aimed to sell to…

Are you sure IBM didn't care about 8080 compatibility? The PC was released in August 1981, a full 4 years before any of the other machines you speak of. That XT 5160-078 you speak of is a cost-reduced model with no hard drive from IBM, allowing dealers to install a compatible hard drive from a different supplier.

By 1985, the PC AT (286) had already been out since August 1984. And the original XT was October of 1983. And the XT itself is literally the same as a PC with more expandability: 8 slots instead of 5, beefier PSU, room for a hard drive.

It's unclear if IBM or for that matter anyone would have been able to start designing a 68000-based machine and bring it to market by the fall of 1981. Sun brought the Sun 1 to market in May 1982, so about 9 months later, and with a much higher price.

And what did the Sun run? UNIX. What did IBM run? Quick ports of the last several years of CP/M software made possible because DOS 1 was specifically designed to implement a CP/M-like API, and the 8086 was specifically designed to allow porting of 8080 assembler code directly to small model 8086 code.

Re: 8086 Segmented Memory was a good idea

#144
post #143

Earlier quoted context omitted.

That was just Sun's market segment. Also from a casual Google, an IBM PC launched in 1985 (picking the XT 5160-078 as an example) was around $4,995 at launch. Compare that to two 68000-based computers also launched in 1985: the Amiga 1000 launched at $1,295 and the Atari 520ST launched at $600. These computer system prices - Sun, IBM, Commodore, Atari - came from the market segments the manufacturers aimed to sell to…

Are you sure IBM didn't care about 8080 compatibility? The PC was released in August 1981, a full 4 years before any of the other machines you speak of. That XT 5160-078 you speak of is a cost-reduced model with no hard drive from IBM, allowing dealers to install a compatible hard drive from a different supplier. By 1985, the PC AT (286) had already been out since August 1984. And the original XT was October of 1983.…

I picked 1985 specifically because of the Amiga/Atari 68000 machines, to show that it's not about price. Had Sun wanted to target the games-machine market, they could've designed for, built and sold a $600 machine based on a 68000 in 1981. Their pricing was because they went for the UNIX workstation market; they also designed and produced their own custom MMU because Motorola's 68851 didn't work correctly for them

Motorola were selling 68000s for $125 each. Steve Jobs talked them down to around $15 each. (Macintosh launch price: $2,495 in 1984) Memory model did not dictate price. Target market and vendor management did.

IBM would have been entirely capable of launching a TMS9900-based PC or a 68000-based PC, had these chips been in full production in 1978. The software and OS for the IBM PC was an afterthought, IBM settled on the CPU first. Had they picked the 68000, they'd have been contracting out for 68000-based OSes.

https://spectrum.ieee.org/the-inside-story-of-texas-instrume...

> Selection of a 16-bit microprocessor by the IBM team couldn’t have been much of a debate. The Motorola 68K, as it was later known, was undoubtedly the hands-down winner. It had the largest logical address space, which was even more important than the minimum 16-bit internal architecture. It was also easily expandable to a full-fledged 32-bit architecture.

> So why aren’t we all using 68K-based computers today? The answer comes back to being first to market. Intel’s 8088 may have been imperfect but at least it was ready, whereas the Motorola 68K was not. And IBM’s thorough component qualification process required that a manufacturer offer up thousands of “production released” samples of any new part so that IBM could perform life tests and other characterizations. IBM had hundreds of engineers doing quality assurance, but component qualifications take time. In the first half of 1978, Intel already had production-released samples of the 8088. By the end of 1978, Motorola’s 68K was still not quite ready for production release.

So it wasn't about architecture, and it wasn't even about price. It was about time-to-market. The 8088 was in full production and the 68000 was not quite there, at precisely the time IBM wanted to create a PC. The 8088 might've been even quicker to market had they left out the memory segmentation, but Intel had their own business reasons (wanting to sell to existing 8080 customers) for adding it.

Re: 8086 Segmented Memory was a good idea

#145

Earlier quoted context omitted.

I recall turbo (Pascal I guess but I was a kid and this was 40 years ago) having options, small for all in one. Then code and data in different segments, but only one each. Then code in one but multiple data, and finally multitude of both. I probably remember the options a bit off but there is enough to state that compilers could handle segments. Though they didn't optimize it well and so the smallest option was fast…

No, that was C (and C++). Turbo Pascal 3.x always had a single code segment, a single data segment, a single stack segment + a heap. Heap allocations were paragraph aligned (ofs=0). All pointers were far pointers. Turbo Pascal 4.0 and up had one code segment per module (that they called units). It still had a single data segment and a single stack segment + a heap. Heap allocations were still paragraph aligned and al…

Like I said, my memory of 40 years ago isn't good. However it is still enough to prove the point, at least C compilers of the era could handle segments.

Re: 8086 Segmented Memory was a good idea

#146
post #35

I had to use it to do image processing on a 256MB image buffer back in the 1980s in assembly language. It was absolutely hideous. Give me a flat 32 bit memory address space any day (e.g. MC68000 around the same time.)

Oops! 256KB, not 256MB. Sorry about that. It was on a dedicated image capture board plugged into the PC.

Re: 8086 Segmented Memory was a good idea

#147
post #37

Earlier quoted context omitted.

> I had to use it to do image processing on a 256MB image buffer back in the 1980s in assembly language.... Give me a flat 32 bit memory address space any day (e.g. MC68000 around the same time.) Huh? There were no segmented x86 machines capable of addressing 256MB of RAM, aside from the 386 (maybe). If you had a 386 and the $130K of memory your statement implies, you probably also could afford a Unix (or something e…

Perhaps they meant KB?

Yes, mental typo. 256KB.

Re: 8086 Segmented Memory was a good idea

#148
Eh. I don't think "developers broke it". The 8086 gave us something like a flat 20-bit address space and then encoded it as a segment. Once that exists, normalizing far pointers is inevitable.

Not to do a "The Amiga was ahead of its time" thing but as a reminder, 68000 has a flat 24-bit address.

Re: 8086 Segmented Memory was a good idea

#149
post #16

For its time it was a decent idea. Software was smaller and simpler. But today (and even before 64-bit) software is larger, more complex, we also need memory protection / isolation and more flexible memory allocation / sharing, so paging memory was not introduced for nothing.

> we also need memory protection / isolation I seem to remember that memory segments came with a permission system (read-only, read/write, execute) in 'protected mode'. Probably only added in the 286 though (I was always more of an m68k guy at that time).

Intel wanted to go full 32-bit with capability-like segments right after 8080 with i432. It took way too much time to design, so they released 8086 as a stair-step to 432. It still took too much time, so they released 286. And when i432 was ready it turned out painfully slow anyway and x86 was completely entrenched because of PC platform so they bite the bullet.

Re: 8086 Segmented Memory was a good idea

#150
post #6

Google's native client (NaCl) even used it on 32-bit x86... Segmented memory (on hardware that supported segment permissions) was used to good effect in Multics as well.

x86 32 bit protected mode segments were a very different beast.

I miss them.
Post reply on HN