Radio Shack TRS-80 Model 100 Basic Manual

-~
-
MODEL
LANGUAGE
~
-
-
100
BASIC
LAB
.1
....
_--
am-._
.
-----'
_
,,,,,,,,,.:0_.. ,
..
·
·
....
....
_
....,no
...
_,,_I'tI_
"'0:0
_
'101
""'"
"""""
"",'OO:1I0,0<J,,;(W< ,
_
..
_ .._
...
_._
_._
_
.-01<1«
""""""""_
__
_.
---
-----,,---
(
,-,,--"'-,-,.-
".....,
o
....
·
·
,.-_..-'"
."'"
",..,•..-
"'1IlIUIl-..
__
,Itf"-
0Ii
(IIi
'0"'-'-"'..
"t
__
"",""""""
USf..__
"",...."
"'
....""..
...
,.,....,.,,_'
M~'
-~
"""'"""""-
..
-
_....-....-
__
-,----
..............
...
_
........
........
..
_fIU
_"",_._
"
~""_
_
..
_
..
._
~_,
.....
_
..
....
__
_0
..
"'''''''''._
"..-.........,.
...........
01
_,
OIl
_,,"
..
....lIDIE"l! ....... 0I(l'l !lQEO ' ...
....
_
""""
UMITID
~'""
....."".......
..
_
..
WSl'""
•.
.....
_...
-
..
_
.._....
....
_
..
~.'
-.
.....,'0
..-,,,.
..
_«OIl
__
__
....
__
__
....
.....
_
_
c.',,,"'
.....
,,,,'_'._
..
-,
e-
_ ..
..
_
_._.-
'._,
_ .. r _ ".._
__
......
"""
_
....
..
""'
.....
__
'""
011
_ tOOl'!IlOS
_
..,.--
...
..
1ItOQ
_,
u_
...
..
:KIlo.
l{Il;S'".......
"'ClMWI<l-""
WIll
""
......
_ _
_
tfl<S..""'''"'
"--,
OS".....-.-"""
-orwlO'll!-
'
"'"
_-
..
_
WARRANTY
__
,_
~
Il'
...
"00l.
,_.-
._*""'
,,
__
..
__
...
__
..
...
-
_
..
_'IU.
"'
..
.:It_,r.-
La
...........
III
--.
,,_
-.orr
..
roo
_ M
,
,u
.....
••.
.IOtI
...
..
_~-~-,----
""'..__
~)
..... _.._or
_..
...
...
_"1_"'.·
....__
__
"""".....,.~"
..
_
__
, t
..
,_
...
__
(OJI[II"
_
-.
''''OT
""'(M'
-..
IJIO IWI<I......,.
__
..
_
..
._
..
_
_
..
""
....-
_
...
_-_.-
_-
._
.....
__
...
,,,...-m
....
l_.~
...
0Il"":lh''''-1lMW)U
_,
_
<I"""""'"
'"
...
'."....u
'SUIlOUT'.._.
JOIi
'""
......
..
-,
__
...
_._.__
,"
,--_
-
__
....
,c.os
""'_.~
........
'.....
~
TOM'MIO"
..
"""""
",.,,,
'",....
.""
.......
_ ......
_11-:>
.....
-_..-_1-
'l
......
._,
~_
.._
.......
..
!HI _ ...
_,$
,,,,_
__
,.."""'-:.·s_
_._._~
__
.....
...
__
~
..
..
WSl
0<JUIlS"
_
_-
._---,
-_
.....
-
-._",
.....
""_.ws,talf,
00,
..
t-..
os
"...."."
~.,
"'~",""
__
""
00'IfCT" (IIi
lUI
""""".'0
......
KI'IlfJS$'"
011•""
Q _
.......
•",..._•
lilli'
""fIW'-'-
lING
_
......
_
...
_
_,"""'"
'
..
~
.......
OM
'"
...
_.
_
...
_
..
......
...
".
_
..
-
"""""
..
...
,
.....,..
..,.,,~
Of'
_
_.,.._
"'
....
.""",..-
t:,
...
,_.
,
•.
-----
--
..
-
I r
(
o
I
o .. .. _
'-
--""._-...
..
·
•.
IlItU
,..__..__
-_
..-..
Q/Sl.......
,-
_-~
_"'_
M'-"
.-
CI.IO,'""'_
-
_
CUS'-""_
...
mOO.-..WllOfI(
CUS
__
""',
Too_...
......
=~.
...
_......
....
__
......
.......
__
.....
........
..
_
,_,_,..-
_..,...
..
__
_,,
Too_
......
_
..
_
...............
...
,
.......
'-•.....,IM'
_
...
,.1ll1
..
-
.....
..
..
••
-
..
,-_
_,--
_.
_._=_...
..
_._.
....
....
••••
....
_CUll<IIIIt;"_
or...
_,
_..,..._
_
....
_
__
_--_
......
_~-"'-_._
----_
...
__
__
....
__
-.
..
_
.....
..
_....:0
...
,..
__
..
__
-
...._..
_
..
__
..
__
"""
....
_.
""""
lMOC"-
!OIIU_..__
....
_
..
_,
.....
__
...
WI'
__
_"J",.....,
....
.....
_,
......
-
J••_
_"'
WS'OOIDll_
__
...
.-
_ ,
,_.,
.,
...
-
...
_ ....~_
__
....
-
wsK:lOlll
....
.......,__
...........
__
..
,_
-_
...
_
__
... _
--_
...
....
....
_
_
....
..,
..
Model
100
BASIC
Language Lab
A DIVISIONOFTANDY CORPORATION
FORT WORTH, TEXAS 78102
Model 100 BASIC Language Lab Program:
© 1983 Tandy Corporation
All Rights Reserved.
Model
100
BASIC Language Lab Program Manual:
© 1983 Tandy Corporation
All Rights Reserved.
Reproductionoruse, without express written permission from Tandy Corporation,ufany portion of this manualisprohibited. While reasonable efforts have been taken in the preparationofthis
manualtoassure its accuracy, Tandy Corporation assumes liability resulting from any errors or omissionsinthis manual, or
from the useofthe information contained herein.
109
8 7 6 5 4 3 2 1
no
Contents
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Lesson Lesson Lesson Lesson Lesson Lesson Lesson Lesson Lesson Lesson # 10 Data Files ' , Lesson #11Average Sales Lesson Lesson #13Function Keys Lesson Lesson
Application # 1 Calculator Application Application
Index
#1
Introduction to
#2
Saving Programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...15
#3
Interest Calculations... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...31
#4
Sales Commissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...45
#5
Day, Time and Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...57
#6
Using the Editor.
#7
Sales Trend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#8
Plot Your Data
#9
Functions
#12
Sound & Simulation
#14
Using the COM Option
#15
TELCOM Applications
#2
Memory Master Game
#3
Descriptive Statistics
BASIC.
"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
.. ..
69 87
99 111 123 131 145 155 165 175
185 189
195
203
Introduction
If
you've used your TRS-80 Model 100 just once, you know how simple, versatile,
to
and powerful a computer it is. Its built-in application programs allow you normally complex computer operations with ease. This includes data manipulation, computer-to-computer communications, word processing, and more.
as
However, computer even more useful by customizing it to suit your own special needs. This done through BASIC, the built-in programming language.
For instance, from BASIC, you can:
• Re-define the Function Keys
• Communicate with information services and other computers.
• Write programs for a wide range performing interest or mortgage calculations.
• Make use
and a host This course will show you how
detail the BASIC section time you've finished this course. you'll be writing your own programs and using the
built-in application programs more effectively.
Since most
since BASIC interacts with the other built-in programs, you'll find it your advantage
you become more familiar with your Model 100, you can make the
(fj)
through
of
of
the computer's graphic and sound capabilities.
of
other operations!
to
perform operations suchasthese by explaining in
of
your Model 100 Owner's Manual. This means that by the
of
the application programs not built-in will be writteninBASIC, and
to
become familiar with BASIC.
(lID.
applications suchasforecasting sales trends and
is
perform
definitely to
is
So sit back and get ready to enjoy your Model out how powerful a computer it really
is!
100 even more. You're about to find
1
it'
Lesson
To use the BASIC capabilities of the Model 100, you must first learn how to communicate with your Computer. Essentially, this involves typing instructions on the
keyboard and watching the display for responses from the Computer. While you can type anything you wish on the keyboard, the Model 100 only responds
to words written in its own something which the Model with an error message.
In this lesson, you will learn a few BASIC commands Computer and write simple programs.
It should be mentioned at this point, that even when you type a BASIC word, the
Model keyboard) for processing by the Computer.
Throughout this Manual, the phrase "enter this command" will be used often. This simply means that you should press Also, when together.
100 will not respond until the ENTER key (located in the right side of the
#1
is
pressed. After pressing
we
tell youtopress
Introduction
"language." This "language"
100
to
BASIC
is
BASIC.Ifyou type
does not recognizeasa BASIC word, it will respond
to
communicate with your
(ENTER),
~
~,
the line just typed is placed in memory
after typing the command or instruction.
you should press both
(SHIFT)
and
(PAUSE)
Accessing BASIC
Priortotyping or editing a BASIC program, you must access the BASIC interpreter the Model 100.
When you Power-Up the Computer, you will see the Main Menu, which shows all the
''files'' that exist in the Model 100's memory. Think
file folders that may hold text or programs.
If
you haven't created any files, the Main Menu displays the built-in application
programs:
11:06:08
TEL
COM
20897
On initial Power-Up, the Main Menu Cursor - the large, dark rectangle - is positioned over the word word by pressing the Cursor Movement Keys
"BASIC."
The Cursor can be placed on any other Menu
«(3
of
these computer files simply
(C)Microsoft
ADDRSS
Bytes
, G , rn ,or rn).
free
of
as
3
To access the BASIC interpreter, simply position the Cursor over the word BASIC and press
CEmR.l.
The Display will then look like this:
TRS-8~
(cpr. 21190
Ok
The number 2119QIindicates the number of free bytes for creating any programs and
it may vary depending upon the capacity have been created and saved.
The word 0
Command Mode
Experiment
A commandisan instruction to the Computer ordering it todosomething
immediately. In this experiment you will learn how to enter a simple command.
First you will attempt to have the Model the name:
JOHN
Model
1983
Bytes
k and the flashing cursor symbol below it, indicate that you are in the
of
100
Software
Microsoft
free
of
your machine and whether any other files
BASIC and ready to begin programming.
#1
Entering a Command
100 print out a name on the display. Type
SMITH
You may use any other name. Now, press
Computer displays the message:
?8N
Error
This message indicates that an error, specifically a syntax error, has been made. The
syntax error occurred because the Computer doesn't recognize John Smith its vocabulary (also knownasthe Instruction Set).
The correct way to instruct the Computer to print the name
PRINTIIJOHN
Be
sure to press quotation marks enclosing the name are recognized as part vocabulary. This way no syntax error occurs and the name appears printed right below the command.
~
8MITH
at the endofthe line. The key word PRINT and the
II
~.
(ENTER)
As soon as you do this, the
as
is
to type:
of
the Computer's
part
of
4
PRINT "JOHN SMITH"
JOHN
Ok
SI'1
I
TH
Use the PRINT command to print your own name if you haven't already done so. Also, try printing other phrases. For example, to print How now brown cow, type:
PR
I NTIIHOW
Notice that the phrase is printed exactly as it appears within the quotation marks, including spaces.
NOW
BROWN
COWII(ENTER)
Experiment
A BASIC executes, one at a time, in a in
that it is precededbya line number.
Here is a simple BASIC program:
This program, consistingofonly one statement, the PRINT statement, accomplishes the same thing
But because the word PRINT is being used in a program and preceded by a line number, it is now called a statement. The number statement is called a line
number, even
Type line10as it appears above. Notice that nothing happens this time when you
press immediately, a program does nothing until the Computer is instructed to execute it. This is accomplished with the command:
Type the RUN command. After entering the RUN command, the program
programisa listofinstructions (or statements) that the Computer
10
PRINT
PRINT
(ENTER).
RUN
#2
"JOHN
as
the command:
"JOHN
What is a BASIC Program?
sequential order. An instruction differs from a command
SMITH"
SMITH"
number.
CENnID
H'J
which is typed before the PRINT
Every lineina BASIC program must have a line
ifthe program contains only a single line.
Unlike a command, which instructs the Computer to perform a task
Don't
forget to press
(ENTER)
is
after typing it.
executed and the nameisdisplayed.
5
10
PRINT "JOHN SMITH"
RUN
JOI·-lNSMI
A more economical wayofinstructing the Computertoexecute your programisto press the RUN Function Key,
(ENTER).
Now
try
a slightly more ambitious program. Enter the following two-line program:
TH
~.
This accomplishes the same thingastyping RUN
10 PRINT
20
GDTO
The second statement in this program begins with line number 20, indicating that this instruction should
is
There thing instruction.
Execute the program with the RUN command or As
name within quotation marks repeatedly. This is known program because the GOTO statement in the second line of the program simply transfers control back to the first line which prints the and/or numbers) again on the next line.
Because of this continuous transfer, the program has
must be terminated manually by you. To
«(SHIFT)
When you press program stopped when it was "broken." For example:
nothing special about the line numbers used in this program. The important
is
that the PRINT instruction has a smaller line number than the GOTO
you can see, unlike the first single line program, this second program prints the
~).
"RADIO
SHACK
MODEL
100"
10
be
executed after the first line which has a smaller line number.
by
in
~,
pressing
no
"break"
the Computer will display a messagetoshow where the
10
the program, press
~.
as
an "infinite
"string"
wayofterminating and so it
(a group of characters
loop"
(BREAK)
6
Note that the program you wrote "scrollsupand off" the screenasthe program
If
began printing. command:
you wish to see the programasyou wroteitagain, enter the
LIST
or simply press the on the Display again.
List
10
PRINT "RADIO
20
GOTO
Ok
LIST
10
Function Key,
SHACK
CEID.
In either case, the program will appear
MODEL
100"
Execute this program again with the RUN command or by pressing (f!l. After letting This time after pressing
CONT
As
you can see, the program resumes execution. The CONT command is used CONTinue execution after the program has been same place where the program was interrupted.
the
program run a few seconds, terminate it by pressing
~,
enter the command:
"broken."
~.
Execution will start at the
to
Experiment
Here's the program from the previous experiment:
1121
PRINT
2121
GOTO
Suppose you want to change line10so that the message reads:
I
LOVE
This can be done by retyping line 10 entirely:
1121
PRINT
"RADIO
1121
MY
"I
#3
Simple Editing
MODEL
LOVE
SHACK
1121121
MY
MODEL
MODEL
1121121"
7
1121121"
(ENTER)
Now, when you list the program with the LIST command or with the (f5) Function Key, the following is displayed:
10
2l2l
Ok
PRINT
GOTO
1l2l
"I
U)VE
MY
110DEL 101Zl"
Execute this programtoverify that the new phraseisdisplayed. Now, instead pressing program again. Pausing a program may be useful when you want displayed before it scrolls off view. pressing
Try a program:
Run this program. The output should
(BREAK)
to
(BREAK)
few
10
20
M\/
LEE
Ok
to
interrupt execution, press the
stop momentarily. To continue execution, simply press the
Of
course this program must still be terminated by
because it stillisin an infinite loop.
other experiments with the PRINT command. Type in the following
PRINT PRINT
NAJvIE
"MY "LEE"
IS
NAME
IS"
be:
(PAUSE)
key. This will cause the
to
read what is being
(PAUSE)
of
key
Now, retype line10to Also, add a semicolon
this
10
20
PRINT PRINT
"MY "LEE"
insert a space between the word
at
the endofline
NAME
IS
10.
The changed program should look like
";
8
"IS"
and the quotation mark.
Execute this program. The output should appear
MY
NAME
Ok
IS
LEE
as:
The printing appears all in one line because the semicolon instructs the Computer continue printing immediately after the first line is printed. The space after
was
the first line
If
you wantedtospace the name further apart, you could add more spaces after
or you could add spaces before Another way
10
line
Now list the program and it should read:
Run this program. The output should appear
so thatitreads:
10
LIST 10 20
Ok
added so that the words
"LEE"
to
space the printing istouse a comma insteadofa semicolon. Retype
PRINT
PRINT PRINT "LEE"
"MY
"MY
NAME
NAME
IS
IS
"IS"
in line 20.
",
"
as:
and
"LEE"
would not run together.
"IS"
to
in
"IS"
NAME
This time line means "begin printing in the next field" (more on fields later).
"IS"
IS
and
"LEE"
L.EE
are spaced several columns apart. The commainthe first
9
Enter the following program:
1121
2121
PRINT PRINT
"HOW
",
"BROWN";
"NOW
"COW"
";
Would you guess what the outputofthis program will produce? When executed, the display will show:
Hm~
Ok
1\IOlr-J
BFWWI\ICOW
The comma in line10caused the two strings HOW and NOW to be spaced several columns apart. The semicolon between the two words
"BROWN"
and
"COW" caused themtoprint without a space. Nowifline10is retypedsothat the comma changedtoa semicolon and the semicolon at the end of the statementisomitted,
1121
PRINT
2121
PRINT
the output would
HOW
NOW
BROWNCOW
"HOW"; "BROWN";
be
"NOW"
"COW"
is
The second PRINT statement produces output on the second line because the carriage return after the first PRINT statement has not been suppressed with a semicolon or
If
comma. you could rewrite your program
you wantedtoprint the words on one line, neatly spaced one column apart,
as
follows:
1121 2121
PRINT PRINT
"HOW"; "BROWN";
"NDW
"CDW"
";
10
When it is executed, it produces,asexpected, the following:
NOW
BROWN
COW
A BASIC program can be edited a line at a time simply by retyping the entire line you have been doing.
To delete an entire line from a program, all you have
to
of the statement you wish
delete and press
~.
todoistotype the line number
For example, list the current program:
PRI NT PRINT
Now
type
20~
If
you list the program again, you will
"HOW "BROWN
"?
"NOW
";
";
"COW"
see
that line 20 has been effectively deleted:
as
1~
PRINT
"HOW";
"NOW";
Ok
I
Retype line 20 to restore your programtoits previous form:
10 20
PRINT PRINT
"HOW "BROWN
";
"NOW";
"j
"COW"
11
A
new
line can be added to a BASIC program at any time simply by typing it with the
If
appropriate line number. number less than
10
you wanttoadd
(the smallest line number allowedis1).Ifyou wanttoadd a line
between the two lines, give it a number between
10
Line numbers numbers had been used, for example inserted.
5).
It
and 20 were usedtoallow insertionofnew lines.Ifsuccessive line
15
is a good practicetouse line numbers that
a statement before line
10
and 20 (e.g., 15).
and 16, thennonew lines could have been
are
multiplesof10
Here's your program again:
10
20
PRINT PRINT
"HOW"j"NOW" "BROWN
II
j
"COW"
j
Suppose you want to insert a line between10and 20. Simply type:
15
PRINT
"SPLENDID
";
~
When you list the program now, it will show:
10,
give it a
(or at least
PRINT PRINT "SPL.ENDID PRINT
"HOW"; "BROWN
"NOW";
"i
!I;
"COW"
Even though line15was typed after lines10and 20, it takes its correct place in the
10
program because its line number falls between
and 20.
Execute this program. The following output will result:
NOW
SPL.ENDID
BROWN
COW
It should be clear by now that any BASIC program can be edited easily with the use
of
the line numbers. You can add, delete, insert, and change lines and that is all you
to
ever need
do.
12
Experiment
By
now you should be able to write simple BASIC programs using the two
instructions PRINT and GOTO.
#4
Writing Your Own Programs
Before you go on experimenting with the spacing comma and the semicolon, you should be aware NEW command.
When you enter the NEW command, any program that has been previously typed and
is
currently residing in working memory will be erased automatically.
Before you begin typing in a new program, you should always use the NEW
command to clear out the old program. Otherwise, you may end
combination Assume that your old program still resides in memory:
10 PRINT
is
20 PRINT
Now, without deleting this program, enter the following new program:
10 PRINT
of
your new and old programs.
"HOW";
PRINT "SPLENDID
"BROWN
"MY
";
COMPUTER
"NOW";
"; "COW"
IS
in PRINT statements using the
of
another useful command, the
-up
with a
A
";
20 PRINT "TOOL."
If
you list the program, you will find it
is:
LIST
10 15 20
PRINT PRINT PRINT
K
"MY
COMPUTER "SPLENDID "TOOL."
";
IS
A
";
Note that line15still exists because that line number was not usedinthe new program. command NEW. This won't be necessary, however, exists
So
remember, before typing a new program, clear the memory with the
if
you are certain that no program
in
memory.
What you have learned:
In this lesson you have learned some commandstowrite and execute a simple BASIC program. The PRINT and GOTO statements have been used to display simple messages. Editing a BASIC program can be typing new lines. The NEW command is used memory.
13
accompli~hed
to
deleteanentire program from
by retyping existing
line~
or
Lesson
In this lesson you will learn howtosave programs in memory and on cassette tapes. You will program with another program.
IJ.lso
#2
learn how to recall a program from storage and how to merge a stored
Saving Programs
Experiment
As
it was mentioned before, the Model 100 can hold several files, many9fwhich can
be
program files, In Lesson 1 you learned to write simple BASIC programsinthe BASIC system use repeatedly, it is a good idea Random Access Memory). When you save a program in RAM, in effect, you create a program file.
The following program serves to demonstrate how any program can be saved in RAM:
10 PRINT "THIS 20 PRINT
Access BASIC. Clear working memory with the NEW command and then type the
program
Execute the program, The following will be displayed:
asitappears above.
THIS
OF
Uk
1::'1
THE
#1
of
the Computer. When you have written a program that you intend to
"OF
A TEf3'T
MODEL
Saving a Program In
to
save it in memory (also knownasRAM, for
IS
A TEST"
THE
100
MODEL
COMPUTER
100
COMPUTER"
RAM
II
The first step for saving a program in RAMisto decide upon a filename. This filename appears listed as a file in the Main Menu and it serves to identify the program. Filenames cannot exceed six characters in length.
You may use any combination character in a filename must always be a letter. The following are examples filenames:
MYPROG
SKETCH ACCNT2
of
letters and digits for a filename. However, the first
of
15
valid
The following are examplesofillegal filenames:
1PROG MICROCOMPUTER
(must begin with a letter) (exceeds the maximum of six
name)
c,haracters in any file
Suppose you want to save the program above under the filename
PROG1
Todothis, simply type:
SAVE
IPROG1"
~
The Display will show the prompt OK to indicate that the program has been SAVEd.
Use the command NEW to clear the program from working memory. To verify that
the program no longer exists in working memory, enter the command:
LIST
or press
LIST
(ENTER)
~,
the LIST Function Key. The computer will respond with:
OK
and nothing else, indicating that there isnoprogram currentlyinworking memory.
It
The program has not been wiped out.
in
now exists
FILES
RAM. To confirm that thisistrue, enter the command:
(ENTER)
has been erased from working memory but it
or press the FILES Function Key,
the
file~
storedinRAM, including all BASIC programs, will be displayed. In this
if
case,
you haven't SAVEd any other programs or files, the name
®.
In responsetothis command, the namesofall
PROG1.BA
willbedisplayed.
is
This
your program. The that this file is a BASIC program. The Computer automatically appends this extension to the name
of
any BASIC program whenitis
If you want more proof that your program was indeed saved as a file, press the Menu Function Key,
CEB).
below.
Jun
22,1983
BASIC SCHEDL
Select:
characters"
.BA"
form a
"file
extension" which indicates
saved in RAM.
You will see PROG1.BA displayedinthe Main Menuasshown
Wed
10:34:17
TEXT
TEL
COM
PROG1.BA .
.....,...
21350
""'.
Bytes
---
free
16
A simpler way to save a program in RAM,isto use the SAVE Function Key, After typing a program you wish to save, simply press prompt you with the message:
~.
The Computer will
~.
Save
All you have to do thenisto type a name for the fileasyou did before and press
(illEID.
The numberoffiles which can be saved is limited only by the amountofRAM available.
up
used
Experiment
After you have saved a program in RAM, you may execute it simplybypositioning the Cursor over the word identifying it in the Main Menu and pressing
However,ifyou wish to modify or alter the program in any way, itisvery convenient to LOAD
Let's use PROG BASIC system.
You can do that with the command:
LOAD
Another way to LOAD the programisto pressing
Load
"
If
you continue to add files to RAM, eventually all available RAM will be
andnomore programs can be saved.
#2
it
into the BASIC system.
1 which you SAVEd in the last experiment and LOAD it into the
"PROG1"
~
the message
"
Loading a Program From RAM
(ENTERJ.
~
press
the
LOAD Function Key.
CE2l.
After
appears on the Display. All you shoulddothenisto type
PROG
1"
(ENTER)
After Loading PROG1 with the LOAD command or (f2), LIST the program to verify that it is indeed in working memory. The following should be displayed:
List
10
PRINT
20
PRINT "OF
Ok
"THIS
THE
IS
MODEL
A
TESTH
100"
I
If you execute the program with the RUN command you will see that the outputisthe
same
as
before.
Enter the command FILES or press
(11).
17
You will see that the program PROG1.BA is still listed, indicating that itisstill saved
in RAM, Loading a program from RAM does not erase it from storage. Notice, however, that an asterisk appears to the right of PROG1.BA. The asterisk
indicates that the program
Use the NEW command to delete the program PROGI from working memory. Use the LIST command to verify that working memory does not contain the program. Now type the command
RUN
"PROG1"
The following should appear on the LCD:
is
currently in working memory.
CEHnID
THIS OF
Ok
THE
IS
MODEL
A TEST
100
COMPUTER
11
This illustrates a useful optionofthe RUN command.Ifthe RUN command is
of
followed by the name quotes), then the program will be loaded into working memory and executed immediately. Thus the command:
RUN
"PROG1"
is equivalent to the two commands:
LOAD RUN
Use the LIST command to verify that the program now resides in working memory. The program will be modified by adding a third line. Type the following line:
30
List the program to verify that it
"PROG1"
CEHnID
PRINT
a program stored in RAM (the name must be enclosed in
00£!lID
mEID
"AND
ITS
is:
AB
I LI
TV
TO
STORE
FILES"
CEBllID
LIST
PRINT PRINT "OF PRINT
"THIS "AND
THE
ITS
IS
A TEST"
MODEL
ABILITY
100
TO
18
COMPUTER"
STORE
FILES
When you LOAD a program from RAM into working memory, you may add, delete,
or insert new lines as you wish. The changes you make are immediately incorporated
into the program. Delete the program from working memory with the NEW command. Use the LOAD
command to recall program
"PROGI"
from RAM. Type:
LOAD
List the program with the LIST command. You should
The new line was effectively incorporated in
"PROG1"
PRINT PRINT "OF PRINT
"THIS "AND
mEID
IS
THE
ITS
A TEST"
MODEL
ABILITY
see:
1~0
COMPUTER"
TO
STORE
FILES
"PROGI"whichisstored in RAM.
You can also LOAD and execute a BASIC program directly from the Main Menu.
(fI) to exit BASIC and return to the Main Menu. You should see something
Press similar to
(
C:>
jvli
Cl
....
[)!::·CJf·
Jun
!
SCHEDL
22.1983
Wed
.10=37:07
TEXT
TEL
PROG1.BA .
COM
(\
DD
i:~
:::\
t
~:j
21350
Bytes
tree
Move the cursor over the filename PROGl.BA as indicated below.
TEL..C()!V!
5CHEDL.
._0.
n
•...•
.••-II--
19
If
you press
loads and executes PROG1.BA. You will see
(ENTER),
several things will happen: the computer enters BASIC and then
THIS OF AND
Ok
THE
ITS
IS
MODEk
A TEST
1~~
ABILITY
COMPUTER
TO
STORE
FILES
with the Ok prompt indicating that you are in BASIC.Ifyou list the program you will see that PROGl.BA is in working memory.
Experiment
Itispossible to change a file name using the command:
NAME
where oldfilenameisthe nameofthe programasit now exists, and new filename the.
new program name you wishtoassign to it.
For example, if you wish to change the filename "PROG
NAME
Verify the name change with the FILES command orbypressing
"old
"PROG 1 •
#3
Changing a Filename
filename.extension"
BA"
AS
AS
"TEST
"new
filename.extension"
1 •
BA"
(ENTER)
1"to"TEST!,"
CEf).
is
typc:
Now, using the NAME
NAME
Again, you may confirm that the name was changed to PROGI with the FILES command.
"TEST1.BA"
Experiment
Whileitis convenient to save your programs in RAM, thereisonly a finite amount space available. Eventually, there willbeno
An alternate method cassette recorder. Using cassettes, you can store essentially an unlimited number programs.
...
AS
command, change the file name back to
AS
"PROG1.BA"
#4
Saving a Program on Cassette
room left for new programs to be saved.
of
saving your filesisto store them on cassette tapes using a
20
~
"PROGl."
of
of
PROGI should still be in working memory. Use the LIST commandtoconfirm that it
It should appear
is.
as:
LIST
10
PRINT PRINT PRINT
If
it is notinmemory you should LOAD it from RAM or type itinas shown above.
"THIS
"OF "AND
THE
ITS
IS
A TEST"
MODEL
ABILITY
100
TO
COMPUTER"
STORE
FILES
To save a program on cassette, it is first necessary to connect the Model
suitable cassette recorder. For optimum results
we
recommend the Radio Shack
100 to a
CCR-81 Computer Recorder (catalog number 26-1208) with connecting cable and
instructions supplied. Be sure that the proper connections are made before proceeding further.
Place a blank tape in the cassette recorder and rewind it,
if
necessary. Then advance the tape past the leader. (If you use Radio Shack Leaderless cassettes, catalog number 26-3019, this isn't necessary.)
Press the RECORD (red key) and PLAY keys down together. They should stay down, but the tape will not move.
If
it does, youdonot have the remote jack inserted. Insert
the jack. Now you are ready to save the program onto the tape. Enter the following command:
CSAVE
"PROG1"
The recorder will run briefly and then stop. The RECORD and PLAY keys, however, will stay down. After the tape stops, you may press the STOP key and rewind the tape.
1.
The program now has been saved with the filename .'PROG
to
Another way
save the program on tape, insteadofusing CSAVE
"
"PROG1"isto
use the command:
SAlJE
"CAS
:filename
II
where CAS: specifies the device to be used for the saving operation,inthis case the cassette recorder, and filename
is
the nameofthe program to be saved. Using this
command, you would specify:
SAIJE
"CAS:
PROG
1"
~
21
Experiment
#5
Loading a Program from
Cassette
The program you just saved on tape in the previous experiment, PROG1, will now be loaded back into working memory. But first, delete PROGI from working memory with the NEW command.
Verify that it has been deleted with the LIST command or Function Key,
Be sure that the cassette recorder is properly attached to the Computer. Insert the
cassette containing the program into the recorder and rewind
Press PLAY on the recorder. The key will stay down, but the tape will not advance. Enter the following command:
CLOAO
As soonasyou press into the Computer.
FOUI\ID:
Ok
If
the tape was not read successfully, an displayed. the CLOAD command again to read the tape.
~.
"PROG1"
(ENTER),
If
thisisaccomplished successfully, the computer will display:
Pf{OG
1
If
this happens, rewind the tape and adjust the volume control. Then use
the tape will start turning and the program will be read
110
(InpuUOutput) error message will be
by
pressing the LIST
if
necessary.
If the tape is read successfully, you may verify that the program memory by listing it with the LIST command (or with displayed:
LIST
10 PRINT
20
PRINT "OF
30
PRINT
Ok
"THIS "AND
THE
ITS
IS
A TEST"
MODEL
ABILITY
10m
COMPUTER"
TO
~).
STORE
The following will be
FILES
22
is
in working
When the command CLOAD until a program stored under the name into working memory.
The command
"PROGI"is entered, the Computer searches the tape
"PROGI"is found. This programisthen read
LOADIICAS
may be used in place of CLOAD "filename". Remember that filename specifies the name
of
the program you wish to LOAD from the cassette.
Delete the program from working memory with the NEW command and verify that it
has been erased by using the LIST command.
Rewind the cassette and press the play key. This time type the command:
CLOAD
When this commandisentered, the cassette recorder will run briefly and then stop. Also, the computer will display:
FOUND:
Ok
:jilename"
COOfR)
PROGl
(ENTER)
II
indicating that the program was read successfully. List the programinmemory with the LIST command. You will see that the same program was loaded from the tape.
This illustrates another option program is omitted, the first program encountered on the tape Since your program PROGI was the first program on the tape, it was loaded into the Computer.
Experiment
Your Model 100 allows you to verify that a program has been saved successfully (i.e. without any errors) on cassette tape. Another option to accomplish this.
#6
of
the CLOAD command. When the filenameofthe
is
loaded into memory.
Verifying a Stored Program
of
the CLOAD commandisused
23
Verify that the program still resides in working memory with the LIST command.Ifit has been deleted, load it from the cassette tape or type it in from the keyboard. Here is
the listing again:
LIs'r
10
PRINT
20
PRINT "OF
30
PRINT
Rewind the cassette tape containing the program and press the PLAY key on the
recorder.
Type the command
"THIS "AND
THE
ITS
IS
MODEL
A TEST"
100
ABILITY
COMPUTER"
TO
STORE
FILES
CLOAD?IIPROG
The recorder will run briefly and then stop. The Computer will display:
Found:
OK
In this case, the program stored on tape was not SAVEd into working memory, but was compared, character by character, with the program already in working memory.
If
an inconsistencyisfound at any point, an error message will be displayed, indicating that the prugram working memory.
If
an error has occured, you can reSAVEthe program and use the CLOAD? command again to check the saved program.
As
with the CLOAD command,ifthe file name is omitted from the CLOAD? command, the first program encountered on the tape is compared with the program in working memory.
List the program in working memory. You should see:
LIST'
10
PRINT PRINT "OF PRINT
PROGl
"THIS "AND
1"
(ENTER)
saved on the cassette tape
IS
A TEST"
THE
ITS
MODEL
ABILITY
10121
was
COMPUTER"
TO
STORE
not the sameasthe one in
FILES
,
24
7
Loading...
+ 180 hidden pages