| ▲ | jdw64 5 hours ago |
| Sometimes I think that if it were the old days, I probably wouldn't have been able to program. I remember that these days we program on top of 64bit virtual addresses, but how did developers do it back then |
|
| ▲ | icelusxl an hour ago | parent | next [-] |
| Memory mapping/bank switching was fairly common on 8-bit and 16-bit systems, where a small memory window was used to select different memory banks, allowing a program to access more memory in chunks. Game consoles like NES, SNES and Game Boy had additional hardware built in the cartridge to support memory mapping/bank switching. For PCs, EMS (memory) provided a similar concept. It reserved a 64 kB window divided in 16 kB pages in the first 1 MB and allowed to map up to 32 MB. |
|
| ▲ | jchw 2 hours ago | parent | prev | next [-] |
| As someone who grew up coding after it was mostly 32-bit, I can't say this with certainty, but my gut feeling is that paradoxically you would have and it would've made you stronger. |
| |
| ▲ | hnthrowaway0315 2 hours ago | parent [-] | | Exactly. I'd argue that all those programming Gods and Gods because they went through that period. Whatever didn't kill them made them stronger. We should replicate that experience by deliberately writing in low level C and assembly for a few years. |
|
|
| ▲ | bananaflag 3 hours ago | parent | prev | next [-] |
| I first found out about segmenting in 16 bit systems in 2016 by reading a lively explanation from an older edition of Duntemann's Assembly Language Step by Step (the newer editions focus largely on Linux and 32/64-bit systems). |
|
| ▲ | hnlmorg 4 hours ago | parent | prev | next [-] |
| 16 bit programs used 16 bit addresses, generally speaking. Even with 32bit systems where you’d want more than 4GB RAM, application software still had 32 bit addresses (and thus 4GB memory limit). I think it was a lot more common for 8bit systems to allow for 16 bit addressing though. It’s been a while though. So hopefully I’m not misremembering things. |
| |
| ▲ | andyjohnson0 2 hours ago | parent | next [-] | | > I think it was a lot more common for 8bit systems to allow for 16 bit addressing though. The 6502 and Z80 could use 16 bit addressing to access up to 64kb of memory. The 6502 had various other addressing systems, including iirc 8 bits, but none of them were wider tha 16 bits. | | |
| ▲ | zabzonk an hour ago | parent | next [-] | | Well, most of the addressing modes of the Z80 used a 16-bit register pair (i.e. 0 to 64K-1 bytes) to address, the 6502 used a somewhat stranger set of addressing modes, but once again you could address 0 to 64K-1 bytes. | |
| ▲ | hnlmorg an hour ago | parent | prev | next [-] | | Oh yeah. I had loads of 6502 and Z80 systems (still do in fact). Can’t believe I forgot about that! Though in fairness, I do mostly now just use those systems to teach my kids BASIC | |
| ▲ | JdeBP 2 hours ago | parent | prev [-] | | Psst! Let's blow their minds and tell them about the MC68008. (-: |
| |
| ▲ | barrkel 3 hours ago | parent | prev | next [-] | | You had to deal with two flavors of pointer, near and far. Far pointers came with segment selector, for accessing more than 64k. Your choice of memory model influenced the defaults. You might use near pointers for internal references in a module, and far pointers for external references. | | |
| ▲ | senfiaj 3 hours ago | parent [-] | | I guess it was awkward to use languages that had higher level than assembly in order to write 16-bit programs that required more than 64KiB of memory. And also not quite portable, since they were all tied to x86 CPU. Those were messy times I guess. A somewhat similar story was 32-bit PAE, where the the CPU could address more than 4GiB physical memory, but software was still 32-bit and virtual addresses were capped at 4GiB. Linus was right that you must have more virtual memory (preferably 10+ times more) than physical, otherwise you have to jump through hoops. https://cl4ssic4l.wordpress.com/2011/05/24/linus-torvalds-ab... |
| |
| ▲ | cyberax 2 hours ago | parent | prev [-] | | Not really. 16-bit programs on x86 used 32-bit pointers (effectively 20-bit due to the segment mechanism). 8-bit microprocessors used 16-bit addresses. |
|
|
| ▲ | kev009 4 hours ago | parent | prev | next [-] |
| Attention spans were longer. |
| |
| ▲ | GordonS 4 hours ago | parent | next [-] | | I've been wondering about this lately. As a kid, I spent hour upon hour learning about computing: typing in Basic code from a magazine into a Commodore 64, playing with music on an Atari STe, learning my way around a DOS command line, dabbling with 3D modelling... just so much stuff that my own kids would never have the patience for. I wonder if it's just that kids today (gods that makes me sound old!) are constantly surrounded by entertaining things to do - gaming, TV/films, music, social media. | | |
| ▲ | hnthrowaway0315 an hour ago | parent | next [-] | | I have been shielding my 6 years old son from electronics, except 40 minutes of TV twice a week. I have no idea how to grow his patience and perseverance, though. He is like me, who doesn't have a lot of patience to begin with, so I can't really guide him through some of the situations. We have been taking him to some activities as well as reading to him but nothing really sticks. I just hope eventually he loves reading and learns in a more traditional way instead of from laptops and pads. | | |
| ▲ | GordonS an hour ago | parent [-] | | We struggled to get our son into reading too, but he took straight away to comics, and from there he had a long stint with graphic novels (e.g. Percy Jackson, Artemis Fowl). You can get more mature graphic novels as they mature and progress, e.g. City of Dragons. And eventually he picked up an Alex Rider book, and hasn't stopped since. He's now how I remember myself as a kid - nose stuck in a book, completely engrossed! |
| |
| ▲ | jdw64 4 hours ago | parent | prev | next [-] | | I think that's actually a pretty accurate observation. I'm not a cognitive science expert, so I don't know the details, but there have been articles about 'popcorn brain' due to sustained attention issues, right? Personally, I use LLMs for coding quite often (in my environment, I'm often forced to use them). Compared to the past, when I use an LLM, the answers come immediately, so it seems harder to focus deeply than before. The generation younger than me, which is more focused on Shorts, probably has it even worse | |
| ▲ | trumpdong 3 hours ago | parent | prev | next [-] | | I think it's an adaptation. Instead of living in a world with limited valuable information we're now living at the end of a firehose of never-ending near-useless information which has to be filtered at high speed. | |
| ▲ | Braini 4 hours ago | parent | prev [-] | | Thats correct - and I notice that on myself. There are just much more things reachable at any point in time compared to our youth it takes real effort to focus. |
| |
| ▲ | hnthrowaway0315 an hour ago | parent | prev [-] | | I have been wondering how to train my 6-year old son and myself to increase my attention span. Some rules are obvious -- cutoff mobiles and pads completely (he doesn't have access to them so it's for me), sit in the library and study from books (I believe this is even possible for programming topics as I can write on paper). Basically, cutting off everything electronics definitely helps -- even putting my phone in the bag improves productivity significantly. But the problem is, my son is unruly. If I put him in the library, most likely he runs around and messes things up, which ends up we leave early without doing anything. |
|
|
| ▲ | rvba 3 hours ago | parent | prev | next [-] |
| You had to figure out so much on your own back then - and reinvent the wheel. For me it is fascinating how today I can learn a foreign language, or how to code by interacting with the LLM. |
|
| ▲ | bitwize 2 hours ago | parent | prev | next [-] |
| 16-bit x86 processors took 20-bit pointers, expressed as a 16-bit segment and a 16-bit offset. The segment was shifted four bits left and then the offset added. Which means there are lots of different segment:offset pointers that point to the same address. Segments are loaded into a segment register (one of CS, DS, ES, or SS) and then combined with an offset pointer in another register to create a pointer in this way. For example, 1e37:0008 would become 1e378. It's complicated and janky as all get-out, but it made more sense if you were coming from 8080/Z80 development, as this was a scheme to ensure some degree of compatibility with 16-bit 8080 addressing while providing access to much more memory. 8086 was not binary compatible with 8080, but was designed so that 8080 programs could be machine converted to 8086 ones. In languages like C, this took the form of three different types of pointers: NEAR, FAR, and HUGE. NEAR pointers were 16-bit offsets only, and dereferenced with respect to the current segment (usually in DS). FAR pointers were full segment:offset pairs but pointer arithmetic was only done on the offset which meant objects could be 64K max. HUGE pointers allowed for objects larger than 64k but at a significant performance cost. |
|
| ▲ | markus_zhang 3 hours ago | parent | prev [-] |
| I think they learned by reading books such as Undocumented Windows or Windows Internals (not to be confused with Windows NT internals), and Microsoft documents. In fact, I’d argue it was more fun than programming Javascript these days. |
| |
| ▲ | JdeBP 2 hours ago | parent [-] | | It wasn't really the 'Undocumented' and 'Internals' books. Pretty much everything in the headlined article was to be found in the SDK, Microsoft Press publications, and in many third party books about DOS+Windows programming. Petzold's Programming Windows book, for example, devoted an entire chapter (chapter 7) to memory management, with diagrams and examples. In the 2nd edition (which I just pulled off the shelf to check) that chapter runs to some 40 pages. | | |
|