Sharp MZ-80B Basic Manual page 12

Personal computer double precision disc
Hide thumbs Also See for MZ-80B:
Table of Contents

Advertisement

4
The file to which the specif ied logical file number has been assigned is accessed by the write or
read command issued by a PRINT # or INPUT # statement or by a file close statement.
CHAIN and SWAP are statements which overlay a program up on another program in the m emory
and transfer control to the overlying program.
The CHAIN statement is used as a GOTO "file name" function.
CHAIN "DEF"
The SWAP statement is used as a GOSUB "f ile nam e" function. Control will be returned to the
first program after the overlaid program has been completed. ( In this case, overlay is performed again .)
Now we will discuss handling and control of various data and program files that m ake use of the
large storage capacity and high-speed access function of our floppy disk unit.
We have already noted that DISK BASIC is capable of handling three kinds of files : two data files
- the sequential access file ( BSD) and random access file (BRD) - plus one program file - the BASIC
text ( BT X) . One more file, the machine language program file (OBJ ) , has been constructed using a sys­
tem program or MONITOR SB- 1 5 1 0 and recorded on the master diskette. This file is intended to be
run alone or used linked with the program in the BASIC text area ; hence, DISK BASIC can utilize it,
but cannot write it or change its contents.
DISK BASIC
In discussing individual file control instr uctions, we will first explain pr o cedur es for constr ucting
and using the two kinds of data f iles ; second, we will explain use of the CHAIN and SWAP file state­
m ents .
Text "ABC"
goto "DEF"
Text "GHI"
SWAP "JKL"
Sequential access file BSD
=r-
BASIC text file BTX
Machine language program file OBJ
Text "DEF"
gosub"JKL"
Text "JKL"
return
END
}
Data file
}
Program file

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents