EasyManua.ls Logo

Commodore VIC-20 - Page 266

Commodore VIC-20
404 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
252
The
VIC
20
User
Guide
The file contains information for the departure and arrival
of
the flights
John
Doe
is
taking to and from San Francisco.
For
simplicity,
we
will say it
is
a single file
that
contains two records: the trip to San Francisco and the
trip back to New York.
Each record contains several fields. The fields are the groups
of
charac-
ters
that
form either complete words
or
numbers.
For
instance, the word
"JUNE"
contains four characters (or bytes) that are stored on the tape
or
diskette as the individual characters
J,
U, N, and E. Logically, however, the
characters should be taken as the whole word: JUNE. Similarly, the
numbers
2,
1,
and 5 should be taken as the number 215. To distinguish the
data within a record, it
is
important
that
the fields be separated.
Data
Transfer
The first time you access a tape
or
diskette file, you may be misled into
thinking
that
the system
is
not operating correctly.
It
would seem logical
that
the disk drive
or
Datassette would operate each time the program reads
or writes from it. This will occasionally be the case,
but
not always. This
is
because the VIC has a small section
of
memory allocated as a data buffer.
Each time information
is
read from the disk or Datassette, the buffer
is
filled. Until those data are exhausted, the drive
or
Datassette will not be
accessed again. Similarly, when you write to the
di~k
or Datassette, data are
first stored in a buffer. When the buffer
is
full, all the
data
it contains will be
stored
at
once.
logical
Flies
and
Physical
UnHs
Input/
output programming describes any programming
that
controls
the transfer of data between the computer and a peripheral device such as
the Datassette, disk drive, or printer. These are all external physical units.
In
order to transfer data to or from one of these physical units, it
is
necessary to
indicate which one you are accessing. This
is
because each unit has a specific
kind of interface and a particular way in which it must receive its input (the
computer's output).
In
addition, if more
than
one device
is
connected to the
computer, you will need to indicate which device you are "talking to."
The computer can also receive data from the Datassette and disk drive,
and the data it receives must be put somewhere. Look at the problem in

Other manuals for Commodore VIC-20

Related product manuals