EasyManuals Logo

Sinclair ZX81 User Manual

Sinclair ZX81
92 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #26 background imageLoading...
Page #26 background image
set to 0 to begin with - & ITEM. Input ITEM, add it to TOTAL, print them both, & go round again.)
6. The automatic listings (the ones that are not the result of a
LIST
statement) may well have you puzzled.
If you type in a program with 50 lines, all
REM
statements,
1
REM
2
REM
3
REM
: :
: :
49
REM
50
REM
then you will be able to experiment.
The first thing to remember is that the current line (with ) will always appear on the screen, &
preferably near the middle.
Type
LIST
(&
NEWLINE
, of course)
& then press
NEWLINE
again. You should get lines 1 to 22 on the screen. Now type
23
REM
& you should get lines 2 to 23 on the screen; type
28
REM
& you get lines 27 to 48. (In both cases, by typing in a new line you have moved the program cursor so that
a new listing has to be made.)
Does this look a little arbitrary to you? It is actually trying to give you exactly what you want, although,
humans being unpredictable creatures, it doesn't always guess right.
The computer keeps a record not only of the current line, the one that has to appear on the screen, but
also the top line on the screen. When it
tries to make a listing, the first thing it does is compare the top line with the current line.
If the top line comes after, then there is no point in starting there, so it uses the current line for a new top
line & makes its listing.
Otherwise, it first tries to make the listing starting at the top line. If the current line gets on the screen
then all is well; if the current line is only just off the bottom of the screen then it moves the top line down
one & tries again; & if the current line is way off the bottom of the screen then it changes the top line to be
the line before the current line.
Experiment with moving the current line about by typing
line number
REM
LIST
moves the cursor line but not the top line, so subsequent listings might be different. For instance,
type
LIST
to get the LIST listing, & then press NEWLINE again to make line 0 the top line. You should have lines 1 to
22 on the screen. Type
LIST
22
which gives you lines 22 to 43; when you press
NEWLINE
again, you get back lines 1 to 22. This tends to
be more useful for short programs than for long ones.
7. What would
CONT
,
CLEAR
&
NEW
do in a program? Can you think of any uses at all for this?

Other manuals for Sinclair ZX81

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX81 and is the answer not in the manual?

Sinclair ZX81 Specifications

General IconGeneral
ProcessorZilog Z80A
Processor Speed3.25 MHz
ROM8 KB
InputMembrane keyboard
StorageCassette tape
Power Supply9V DC
Dimensions167 mm x 40 mm x 175 mm
Release Year1981
ManufacturerSinclair Research
Weight350 g
Operating SystemSinclair BASIC
RAM1 KB
PortsTV out, expansion port
DisplayTelevision (RF modulator output)

Related product manuals