ZX/TS RAM Pseudo Disk

Authors

Publication

Pub Details

Date

Pages

If you have a 64K RAM on your ZX/TS, you can recover from crashes by periodically saving your work in high memory, as a snapshot of your current 16K environment. You need a reset button (a momentary contact normally open pushbutton between edge connector pins 21A and 4B, with a 10 ohm 1/4 watt series resistor) and a short machine language routine hidden in the 8K to 16K area (where most 64K RAMs put extra memory).

You cannot, of course, use this as backup if your work in progress exceeds 16K RAM (if you don’t adjust RAMTOP, this can’t happen anyway). And this won’t save you if you accidentally lose power (since the RAM will forget — unless it’s battery backed up). But if you’re working in machine code and the system crashes, chances are good that you can retrieve your work from the last time you stored a snapshot.

Enter the program listing and RUN. Then type these numbers, pressing ENTER after each:

017 000 128 024 003 017 000 192 213
205 035 015 209 033 000 064 001 000
064 237 176 201 033 000 128 024 003
033 000 192 213 205 035 015 209 017
000 064 001 000 064 237 176 201

Now you can erase lines 5 and 20 and SAVE the program and array to tape. After you LOAD, start with GOTO 10.

Once you’ve loaded this routine, you can take snapshots of your worK. A 64K memory will hold two snapshots as well as the 16K main working memory. To take a snapshot, use:

RAND USR 8192 for snapshot #1
RAND USR 8197 for snapshot #2

To reload after a crash, or just to see what’s in each snapshot memory, reset the computer (if it crashed) and use the command:

RAND USR 8214 to load snap #1
RAND USR 8219 to load snap #2

This routine always puts you in FAST mode, since loading a snapshot made in SLOW mode while in FAST mode (or vice versa) would cause the system to crash.

These USR calls can be used inside programs, too. The same rules as for LOAD and SAVE apply: if you RAND USR 8192 inside a program, then when you RAND USR 8214, you will be right back where you were at the time of the RAND USR 8192, even RUNning.

Even if you don’t have a need for crash recovery, you can store your two favorite programs in high memory snapshots and then have them instantly when you want them. You will not, of course, be able to use them in conjunction with what you were doing in the main memory.

Be sure not to load a snapshot that you never saved; the system will crash. Also, if you have 32K memory with RAM between 8K and 16K, you can use snapshot #1 but not #2.

5 DIM D(44)
10 FOR A=1 TO 44
20 INPUT D(A)
30 POKE A+8191,D(A)
40 NEXT A
HEXCODE    LABEL    MNEMONIC
============================
110080 LD DE,8000
1803 JR A008
1100C0 LD DE,C000
D5 PUSH DE
CD230F CALL 0F23
D1 POP DE
210040 LD HL,4000
010040 LD BC,4000
EDB0 LDIR
C9 RET
210080 LD HL,8000
1803 JR A01E
2100C0 LD HL,C000
D5 PUSH DE
CD230F CALL 0F23
D1 POP DE
110040 LD DE,4000
010040 LD BC,4000
EDB0 LDIR
C9 RET
00 NOP
00 NOP

Products

 

Downloadable Media

 
Scroll to Top