6 ms·
The riddance of segmented memory.
by amelius 5y ago
The riddance of segmented memory.
- infogulch 5y agoHave you heard of this newfangled device called a Graphics Processing Unit and "VRAM"?
- amelius 5y agoYeah, but that's GPU, not CPU. Hopefully we will see similar progress there in the next 40 years.
- dragontamer 5y agoThat's not "segmented memory". Segmented memory was a 16-bit processor trying to access a 32-bit space (good grief, I forgot the details). You'd have "segment registers", such as "ds" or "es". Reading/writing to memory was by default to the "ds" segment (a 64kB region). If you wanted to read/write to a different segment, you needed to make sure that es, or fs, or one of the other segment registers were available. If you look at old Win32 code, you might see "far pointer" and "near pointers". "far pointers" were 32-bit pointers that would load the appropriate segment register, while "near pointers" were 16-bit pointers that only made sense within certain contexts. It was a nightmare. "Flat Mode" eventually became the norm when processors had enough space to just store full sized 32-bit pointers (and later, 64-bit pointers). "Flat mode" made everything easier and now we can forget that those dark ages ever existed...
- vardump 5y agoThe alternative wasn't that great either. Having just 16 address bits allowed you 64 kB of data memory and code memory that were stuck into same RAM area is a lot worse alternative (for example 8051 was like that). Or 65816 style banks, ugh. If you had to have just 16 address bits, having code (CS), stack (SS), data (DS), extra (ES), etc. segments was actually pretty nice. Memory copying and scanning operations were natural without needing to swap bank in the innermost loop. Of course if you could afford 32-bit addressing, there's no comparison. Flat memory space is the best option, but I don't think it came for free.
- _0w8t 5y agoThe segmented memory may come back to provide a cheap way to sandbox code within a process.