When The Computer Gets Full - Sinclair ZX81 User Manual

Hide thumbs Also See for ZX81:
Table of Contents

Advertisement

Chapter 23 - When the computer gets full
The ZX81 has a limited amount of internal storage, and it is not hard to fill it up. The best sign of this
happening is usually an error report 4, but other things can happen and some of them are rather strange.
The exact behaviour depends on whether you have a memory expansion board attached, so first let us
assume that you have not. If you have, take it off (after first switching off the computer).
The display file, that is to say the area inside the computer where it stores the television picture, is
cunningly designed so that it only takes up space for what has been printed so far: a line in the display
consists of up to 32 characters and then a NEWLINE character. This means that you can run out of
memory by printing something, and the most obvious place is while making a listing. Type
NEW
DIM A(150)
10 FOR N=1 TO 15
20 PRINT N
Here comes the first surprise: line 10 disappears from the listing. The listing is bound to include the
current line, 20, and there is not room for
both lines. Now type
30 NEXT N
Again, there is only room for line 30 in the listing. Now type
40 REM X (without NEWLINE )
and you will see line 30 disappear and line 40 jump to the top of the screen. It has not been entered in the
program - you still have the
mechanism that gives the bottom half of the screen 24 lines to give it priority over the top half. Now type
XXXXXX (still without NEWLINE )
and the cursor will disappear - there is no room to display it. Type another X, without NEWLINE , and one
of the Xs will disappear. Now type NEWLINE . Everything will disappear, but the program is still in the
computer, as you can prove by deleting line 10 and using
10 FOR N=1 TO 15
again - it will move up to the top of the screen as line 40 did. But when you press NEWLINE , it will not be
entered, although there is no error message or
there being no room to check the syntax of a line, and usually happens only for lines that contain numbers
(other than the line number at the beginning).
The only cure is to make some space somehow, but first delete the line 10 that won't go in. Press EDIT :
the screen will go blank, because there is no room to bring the line down.
When EDIT does not work it is sometimes possible to make space by typing a number of spaces until
the cursor moves up the screen.
Press NEWLINE , and you will get part of the listing back. Now delete the line 40 (which you didn't really
want anyway) by typig
40 (& NEWLINE )
Now try typing in line 10 again - and it still won't go. Rub it out again. You must still find some extra
space somewhere. Bear in mind that the reason that line 10 was rejected was probably that there was no
room to check the syntax of the two numbers, 1 & 15: so if you delete line 20 in the program you might
have room to enter line 10, and still have room to re-enter line 20 (which contains no number) afterwards.
Try this. Type
20
10 FOR N=1 TO 15
cursor and can move it about. All you have seen is some obscure
marker to say that anything is wrong. This is the result of
&
. Now type

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents