Why do the memory addresses in a 1k ZX81 start at 16384, and not 0? Or 1?
I understand 16384 is 1024x16. Is it something to do with the 16k Ram Pack always having been planned from the beginning, or something else?
ZX81 Memory Confusion
Re: ZX81 Memory Confusion
On Z80 machines ROM starts at #0000.
The ZX81 is designed that RAM starts at 16384 (#4000) and games load at 16393 (#4009).
It is a fact where you have to work with
The ZX81 is designed that RAM starts at 16384 (#4000) and games load at 16393 (#4009).
It is a fact where you have to work with
- 1024MAK
- Posts: 5332
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: ZX81 Memory Confusion
The memory address does start at zero, that’s the ROM.
However, I presume you actually mean, why does the RAM start at 16384?
The answer is that the machine deliberately uses partial address decoding to keep costs of the hardware low. The 64K (65536) address range is deliberately divided into four:
The first ¼ is the area allocated to the ROM.
The second ¼ is the area allocated to the RAM.
The third ¼ is a “ghost” of the ROM area. An unmodified system does not use this area.
The last ¼ is the ghost” of the RAM area that is needed for the display hardware to work.
Each ¼ is of course 16K (16384 bytes).
More detailed information is in this topic.
Mark
However, I presume you actually mean, why does the RAM start at 16384?
The answer is that the machine deliberately uses partial address decoding to keep costs of the hardware low. The 64K (65536) address range is deliberately divided into four:
The first ¼ is the area allocated to the ROM.
The second ¼ is the area allocated to the RAM.
The third ¼ is a “ghost” of the ROM area. An unmodified system does not use this area.
The last ¼ is the ghost” of the RAM area that is needed for the display hardware to work.
Each ¼ is of course 16K (16384 bytes).
More detailed information is in this topic.
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Autumn is here. Bye bye summer 2024...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Autumn is here. Bye bye summer 2024...
Re: ZX81 Memory Confusion
Sinclair just wanted to make a cheap computer. So they made the memory map very simple:
However some people are smarter, and have made hardware that goes beyond these limitations.
Well not so fast. There actually exists new hardware that can put RAM in the total 64k.
- Address 0 - 16k would be ROM, even though only 8k ROM is installed.
- Address 16k - 32k would be RAM. 1k internal RAM, or 16k external RAM pack. External RAM disables the internal 1k of RAM.
- Address 32k - 64k is used to "execute" the data on the screen, to write data on the screen. This part is the most complex of the ZX81, and long articles have been written about this. (Or what 1024MAK said, as he knows the details of the hardware better than I.)
However some people are smarter, and have made hardware that goes beyond these limitations.
- If you add memory that responds to addresses 32k - 64k it works, however only for data. No machine code works here.
- A modification called M1NOT, will enable machine code running at address 32k - 48k.
- You can add RAM between 8k - 16k, even though Sinclair intended it for extra ROM. But since all programs are load into address 16k and upwards, it's a little trickier to get software here. You can run machine code from here, but you have to load it as part of a program, and copy it down to this location. Basic cannot run at address 8k - 16k.
Well not so fast. There actually exists new hardware that can put RAM in the total 64k.
- The ULA replacement vLA, can be switched into a mode, where the total memory is RAM. And you can copy your custom ROM image into this RAM before enabling it.
- Wilf Rigter's 64k RAM project can do the same.
Re: ZX81 Memory Confusion
These are brilliant replies. I understand now. Thanks.
A really great community.
A really great community.