Memory Decoding Above 16K

Author(s): John Oliger
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n5 (Volume 3, Issue 5)
Date: May 1982
Pages: 5

Sinclair made the ZX81 RAM easy to decode up to 16K, but you may want to add memory beyond this point. To add more than 16K memory to your ZX80/81, you must do more than just:

___     ___     ___     ______
A13 AND A14 AND A15 = ROM CS

You’ll also need to account for the behavior of the display file.

If you decode your 1st 16K block with A14=1 and A15=0, the system crashes. ZX computers need the display file active for display, and the 8K ROM makes A15 high during display. You can use the relation:

___________________
               ___  ______
A14 AND (M1 OR A15)=RAM CS  0-16K

To get the second 16K block use:

___________
___         ______
A14 AND A15=RAM CS  16-32K

Get the 3rd 16K block using:

________________
                __  ______
A14 AND A15 AND M1=RAM CS  32-48K

Sinclair RAMs lack this decoding; you must add it to stack 16K modules.

Use of high-memory sites is limited by the 8K ROM. You can’t run Z80 machine language routines here, nor extend the display file past 32768. Store variables and arrays in these high locations.

To find the end of the display file,

PRINT PEEK 16400+256*PEEK 16401.

With the extended memory, you must POKE 16388,255 & POKE 16389,255 & NEW, after you power up, but before you load any program. (The ZX81 only checks memory addresses up to 32768, and sets RAMTOP there when you power up.) If you poke RAMTOP too high, your computer will set it correctly after the NEW command.

All Gates--74LS00; RAM CS decoding for 0-16K 16-32K and 32-48K
All Gates–74LS00; RAM CS decoding for 0-16K 16-32K and 32-48K