Live data from Hacker News

8086 Segmented Memory was a good idea

owl.billpg.com

121–130 of 150 posts

Re: 8086 Segmented Memory was a good idea

#121
post #83

Wow.... I remember writing 8086 assembly on MASM and another assembler I've forgotten the name of, and then also doing inline ASM in Turbo C++ The segment thing and the convoluted different pointer math caused real gymnastics if you ever had data bigger than 64k... such as images. I always thought of the segments as windows of 64k but moving between those windows, esp with the limited register set, required some real…

Contemporary hardware rarely had images over 64k and memory bandwidth at the time made them a laughable concept.

Re: 8086 Segmented Memory was a good idea

#122

Earlier quoted context omitted.

I think you are missing the entire point of the article (which I kinda agree with), and just repeating the popular wisdom. In the era a machine with "object addressing" sounded like a perfectly valid futuristic design (what a Lisp machine strived to be; I guess today you would call it tagged memory of some kind). The 8086 is not that, but the original design would have allowed to evolve it into something like that. T…

But with only four segment registers, you couldn't treat it as that - not unless you only had four objects. So treating it as a sliding window was all you actually could do with it.

That's almost like saying that with 2 registers you can only do additions with 2 operands. True, but missing the picture. The number of segments is not limited by the number of segment registers, or even (gasp!) by the number of segment descriptors.

Re: 8086 Segmented Memory was a good idea

#123
post #3

Earlier quoted context omitted.

Indeed, I say as much at the end. But what should Intel have done? They needed a CPU that can run 8080 code but with more memory. Also it's the year ~1980 and we're limited to the technology of the age. A system with 64k sized windows seems unavoidable. If you extend the size of the address registers, 8080 code will only run in the first 64k, or require some kind of current window register. An 8080 mode might have wo…

> Also it's the year ~1980 and we're limited to the technology of the age. Tbf the Motorola 68000 which was released around the same time (1979) had a proper linear address space with 32-bit address registers (of which 24 bits were wired up). Also the 8086 was intended as a cheap and temporary stop gap until Intel's "proper" 32-bit CPU architecture was ready for prime time (the doomed iAPX 432).

The Motorola 68000 was roughly an order of magnitude more expensive than the Intel 8086.

Re: 8086 Segmented Memory was a good idea

#124
The author assumes the way to keep segments going with larger memory would have been to change the amount of overlap, but it would have also been possible to make an 80286 where the segment registers were > 16bits, and everything else is 16 bits like before. Now you have extra segments that are still paragraphs apart and existing software could still function (you'd need new instruction variants to move data into and out of the enlarged portion of the segment registers.. call them ECS, EDS, or whatever). Anyway, just a thought.

Re: 8086 Segmented Memory was a good idea

#126
post #96

Earlier quoted context omitted.

Probably talking about swapping it in from some external datastore. These days you would open the file and dump it into a single buffer and rip across it, and not even really stress about it. Even 256 meg of hard drive. That would have been impressively expensive in the 80s. Back then you had to chunk it out and fiddle with the offsets. Even then you still would have had to manage loading out the next chunk. If my me…

> Even 256 meg of hard drive. That would have been impressively expensive in the 80s. I only have a couple reference points around this scale: My dad's company had a system set up with a searchable index of a bunch of legal testimony. It was a Compaq Deskpro 386 running Unix with an attached 1GB disk. The 1GB disk set up was as big as the machine itself. A few years later, I worked with a Cyber mainframe equipped wit…

I remember my dad bought a 500MB hard drive for our Apple IIgs. It cost like $500-600 as I recall, not cheap by any means. I remember thinking that no way would we ever fill it up - which, to be fair, we never did. 500MB would fill up instantly now, but programs and data were so much smaller back then that it lasted until the computer eventually stopped being used.

Re: 8086 Segmented Memory was a good idea

#127
post #97

Earlier quoted context omitted.

> As a person who's been participating in human-to-human communication your entire life, you probably have a pretty well-developed sense of how to structure the flow of a piece of communication. Not OP, but this is where you're wrong. The vast majority of people, myself included, have difficulty structuring communication for effectiveness to a wide audience. When I manage to pull it off I'm very proud of the work, bu…

He's not writing the bible. He's writing a blog post about segment registers. It's fine if there's a sharp edge here or there. You're probably better at communication than you think, and your readers are probably less picky than you're imagining. An occasional sharp edge in your text is not the end of the world.

The original texts of the Bible have lots of “bad grammar” and “poor spelling”, too!

Re: 8086 Segmented Memory was a good idea

#128
post #115

Earlier quoted context omitted.

Thanks for responding. The problem is: - the “make it flow” made it flow in an AI generated way like short paragraphs that are one short sentence. - I now have to decide if this is entirely AI generated and thus not worth my time reading or not. - I would prefer to just interact with you as a real person; your writing doesn’t have to be perfect for what you write to be worth reading.

shrug I've reviewed what I originally wrote and I prefer the text I published. Sure, I could review it all myself (indeed I used to) but that takes time and it was becoming a barrier to actually publishing stuff. Maybe I'd have got around to finishing it in a few months. I don't use AI to write for me. I hate people who do that.

Yeah. My challenge is how to distinguish from folks like you versus pure AI generated stuff. (I’ve added you to my mental whitelist, though, so I expect to enjoy posts from you in the future despite the AI tells in the grammar.)

Re: 8086 Segmented Memory was a good idea

#129
post #74

Earlier quoted context omitted.

I'm sure a modern compiler would have no problem with it, but in 1980 optimizer technology wasn't there yet. Modern compilers use more memory that engineers would dare dream of in 1980. By having no problem I mean we know enough about writing an optimizer to write such a thing. I don't think any compiler does, just that they could.

Compilers in 1980 generated 64k code segments and had no other memory model. Most people wrote assembler particularly if they wanted to use more then 64k. Most non assembly programs were interpreted oddly enough and most such interpreters were also mostly 64k.

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 fastest

Re: 8086 Segmented Memory was a good idea

#130

Could have been fixed with an ADC-type instruction that operated on segments. Imagine if you could have done something like this: add si, some-delta adsc es, 0 in order to move a seg:ofs ptr forward by 'some-delta' bytes. ADSC (add with segment carry) would do: segreg := segreg + imm + 1000h (if carry) or: segreg := segreg + imm (no carry) Maybe there should also have been an instruction to normalize a seg:ofs ptr (s…

btw, we only really need ADSC for the ES register.
Post reply on HN