How to use the disk unit.
by Grecu Cristi from Romania.
Translated from the HC-2000 User's Manual
Chapter 4.2 The floppy disk unit
The floppy disk is controlled by a 8272 (FDC) floppy disk controller, that
provides command signals for interfacing the computer with two disk units.
This circuit may work in simple density format (FM IBM), or in double
density format (MFM), including double faced.
As we showed in the previous paragraph, HC-2000 has an internal flexible
disk unit, 3.5", double faced, 80 tracks, 720 K.
Warning! Don't turn on or off the computer while it has a disk in the disk
unit. The informations on the disk might be damaged.
We don't recommend the use of 3.5" HD floppy disks (1.44 Mb)
To work with the disk, you must know the following things:
- Inserting a disk.
The disk must be inserted with the label on top (so with the rotation
mechanism down) and with the
metal door forward.
If the cutting up from the left of the disk is uncovered, the disk is
write-protected. The HD disks (not recommended) have a second cutting up,
on the right side. This doesn't influence the work, so ignore it.
- Handling the disk:
a. Don't open the protection metal door of the disk!
b. Don't approach magnets to the disk!
c. Insert the disk into his box after use.
d. Protect the disk against liquids, dust and cigarette ashes.
e. Keep the disk at a temperature between 10°C and 55°C, at relative
humidity between 8% and 80%.
4.3 The first operations with the disk.
The internal floppy disk unit will be called "Minidrive 1" or
simply "drive nr. 1"
Auto-run
Maybe you are curious what programs are on the demonstration disk. Insert
the floppy disk in the Minidrive (or, it you have two minidrives,
Minidrive 1), and type:
NEW
Followed by:
RUN (and RETURN)
These commands will start the automatic loading and running the first
program on the Floppy. After you finished to watch this program, continue
to read.
The catalog.
To find out what other programs are on the demonstration floppy disk,
insert the CATalog instruction:
CAT 1 {CAT = extended mode + ss + 9}
In about three seconds, on the screen will be displayed:
- a list of all the files stored on the floppy;
- the free space (in Ko)
Loading programs.
The next step is to load the program you wish to put into execution.
Choose a program, and type:
LOAD*"d";1;"Name"
|
| |
|
|
+------Insert here the name of the program that you choosed
|
+--------------"d";1 identifies the minidrive that you are
currently using
+-----------------------The star communicates to the computer that you are
using the minidrive, and not the ordinary cassette interface.
After a short break, the screen will display the message OK, (without the
name of the program). Now you can launch the program (with RUN).
4.4 Using the minidisk for programs.
Saving, verifying, loading and merging programs
In the HC-2000 User Manual you found the instruction SAVE, that saves
programs on the tape. Saving the programs on the disk is done in the same
way. As an example, we will use the following program, named Squares. It
types numbers from 1 to 10, together with their squares.
10 REM Squares
20 FOR n=1 to 10
30 PRINT n , n*n
40 NEXT n
To save this program on tape, you would have entered:
SAVE "squares"
To save it on the floppy in minidrive 1, type:
SAVE*"d";1;"Squares"
After a few seconds, during the border will twinkle, the program will be
saved. The programs saved on Floppy may have a length of 11 characters.
As you have probably already imagined, you can verify the correct saving
of the program on the floppy by typing:
VERIFY*"d";1;"Squares"
The screen will display the OK message.
Now you can load the program Squares, by typing:
NEW
Followed by:
LOAD *"d";1;"Squares"
Now, if you want the program to be launched automatically, type
SAVE*"d";1;"Squares2" LINE 10
Then:
NEW
And then:
LOAD*"d";1;"Squares2"
The minidrive can be used to merge programs. Type:
NEW
Followed by
100
REM other squares
110 FOR n=11 to 20
120 PRINT n , n*n
130 NEXT n
Now type:
MERGE *"d";1;"Squares"
and the Squares program will be added to the listing.
Shortly, as you realized, the syntax used for the ordinary tape interface
is applied to the minidisk.
Deleting programs.
Supposing you finished to work with the Squares programs. To delete it,
type
ERASE"d";1;"Squares"
During the ERASE instruction, the border will twinkle.
Formatting disks
Before the first utilization of a floppy disk, insert it into Minidrive 1
and type:
FORMAT "d";1
"d";1 indicates the minidrive you are using. Currently,
minidrive 1.
Formatting a disk takes usually 30 seconds. During this time, the border
will become black at the beginning, and will be returned to white short
before the OK message will be displayed. The format process initializes
every track on the floppy, by writing identification fields and data
corresponding to every sector. After a track is formatted, each sector is
read, and the control sum is verified. The OK message will be displayed
only if all the sectors could have been read correctly. (disks with
sectors that contain errors will not be accepted).
Formatting a disk must never be repeated, because through the format, all
the information on the disk will be erased.
Now type:
CAT 1
After a few seconds, during the border will twinkle, the error message
will be displayed:
File not found
Installing the Auto-run facility
A few moments ago you used the autorun facility for the demonstration
disk. If you have a program you used frequent, you can make your own
autorun program, so you won't need to type LOAD and RUN.
These are the rules you must follow:
- the program must be named run
- the floppy must be Minidrive 1
- the facility must be used right after power on, or immediately after NEW
command
Type your program, followed by:
SAVE*"d";1;"run" LINE number
|
|
|
+---insert here the starting line
+----run must be typed letter by letter; don't use the RUN command.
Now type
NEW
Followed by RUN.
4.6 Data files on the disk
Opening a data file
Storing informations on the floppy can be done in files. Every file
receives a name, to be found lately. The instruction that opens and gives
a name to a file has always the same form:
OPEN # 4;"d";1;"Numbers"
| | |
| | +--"Numbers" is
the name of the file.
| +---------"d";1 identifies the
Minidisk you are using
+--------------the stream may be any number from 0 to 15.
This instruction makes two actions simultaneously:
- Attaches a stream to a channel "d";1;"Numbers"
- Attaches this new channel to stream #4
The operation will take a few seconds, during the computer will search on
the disk a file named "Numbers". Because it does not exist, it
opens the channel for writing. (If it would have found a file named
"Numbers", it would have opened it for reading.
Entering data
Once you have opened you can enter data. Supposing that you want to type
in the file named "Numbers" numbers from 1 to 10 together with
their squares. Type and run the following program:
10 FOR n=1 to10
20 PRINT #4;n'n*n
30 NEXT n
You may believe that the numbers have already been stored on the floppy.
But in fact, the computer doesn't transfer automatically data on the
Floppy, only after an amount of information is accumulated, will be
transferred all at once. This method is named "blocking" data. A
block on the floppy has the length of 256 octets. (or characters).
To store data on the floppy, these are entered when you close a file.
Until you don't close the file, data won't be stored.
Closing a file
Closing a file provides storing of the data on the floppy. It also close
the channel (our case, "d";1;
"numbers"), and closes the stream (our case #4) from any
channel. To close a file all you have to do is to close the assigned
stream.
CLOSE #4
The border will twinkle and the information will be stored on the floppy.
Reading data from a file
To read the data from the file "Numbers", run the following
program:
10 OPEN
#4;"d";1;"Numbers"
20 for b=1 to 10
30 INPUT #4;m;n
40 PRINT "The square of ";m;" is ";n
50 NEXT b
60 CLOSE #4
RUN
Because the file "Numbers" is already on the floppy disk, the
channel "d";1;"Numbers" is opened for input, and any
try to write would generate an error.
You may also use the INKEY$ function to read from a file (it always
returns a character). Try this program:
10 OPEN#
11;"d";"listing"
20 LIST #11
30 CLOSE #11
40 OPEN#12;"d";1;"Listing"
50 PRINT INKEY$ #12
60 GO TO 50
This program will return End of File.
7.7 Error messages
CODE error
You have tried to load a block that has the length longer than the
specified length by the LOAD instruction
Disk error
During the execution of a I/O disk command , an error appeared on the disk
that could not be repaired.
Disk Full
You tried to write on a disk that didn't have enough free memory
Disk "R/O"
You tried a writing operation on a changed support, without telling the
computer that you finished to work with the old one. Use the command NEW
or CLOSE #.
Disk 'write' protected
File not found
The file is not found, or the disk is empty
Invalid drive number
You specified is bigger than 2, or you declared minidrive 0, without
declaring it through a direct call.
Invalid name
The length of the file name is bigger than 11 or is 0
Missing drive number
You must specify drive 1 or 2
Program finished
You tried to run a line beyond the last line of the program.
Verification has failed
Writing to a 'read' file
You tried to write to a existing file. The file must be first deleted, and
then re-writ.
Wrong file type
You tried to load a program on a code or data file, or inversely.
|