Data, channels and streams
As you know, a program is a set of operations which is executed when you
type RUN. Data, on the other hand, is any collection of letters, numbers or
symbols on which a program might operate. An example is the numbers
1 to 10 with their squares.
Data can be sent to, and come from, various parts of a computer system
Such parts are known as channels. The channels you can send data to are:
- your screen,
-
a ZX Printer,
-
a Microdrive file, to store it,
-
another ZX Spectrum computer, if both computers are on a network.
-
the RS232 Interface and from there, for example, to a modem or printer.
And the channels from which data can come are:
- the keyboard,
- a Microdrive file,
- another ZX Spectrum computer, if both computers are on a network,
- the RS232 Interface, a modem or a terminal.
The routes along which the data flows to and from these channels are
known asstreams. In the Spectrum computer system the number of these
streams is fixed at sixteen. They are numbered from 0 to 15, and stream
numbers are always preceded by the sign X
Four of these streams come already linked to channels:
stream # 0
output data to the lower part of the television
stream Xl
screen and
input
from the keyboard;
stream #2 outputs to the upper part of the television screen,
but cannot input;
stream #3 outputs via the ZX Printer; but cannot input.
21