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 #43 background imageLoading...
Page #43 background image
5. A subroutine can have several entry points. For instance, because of the way our main program uses
them, with
GOSUB
1000 followed immediately by
GOSUB
2000, we can replace our two subroutines by
one big one that adjusts L, S & D & then prints them. It has two entry points: one at the beginning for the
whole subroutine, & another further on for the printing part only.
Make the necessary rearrangements.
6. Run the program:
10
GOSUB
20
20
GOSUB
10
The return addresses are pushed on to the
GOSUB
stack in droves, but they never get taken off again &
eventually there is no room for any more in the computer. The program then stops with error 4 (see
appendix B).
You might have difficulty in clearing them out again without losing everything, but this will work.
(i) Delete the two
GOSUB
statements.
(ii) Insert two new lines
11
RETURN
21
RETURN
(iii) Type
RETURN
The return addresses will be stripped off until you get error 7.
(iv) Change your program so you don't get the same thing happening again.
How does this work?

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