Remix.run Logo
hnlmorg 4 hours ago

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.