1 |
9 |
samiam9512 |
SHERRY BROTHERS TINY BASIC VERSION 3.1
|
2 |
|
|
|
3 |
|
|
THIS IS A COPY OF LICHEN WANG'S 'PALO ALTO TINY BASIC' WHICH HAS BEEN
|
4 |
|
|
MODIFIED TO INCLUUDE MORE FUNCTIONS, AND DISK SAVE AND LOAD.
|
5 |
|
|
IT SETS IT'S SIZE TO WHATEVER SIZE YOUR SYSTEM IS, SO IT DOES NOT NEED
|
6 |
|
|
TO BE REASSEMBLED FOR DIFFERENT SYSTEM SIZES.
|
7 |
|
|
IF YOU HAVE ANY PROBLEMS WITH IT GIVE ME A CALL OR WRITE ME AND I WILL
|
8 |
|
|
SEE WHAT I CAN DO. HERE IS MY ADDRESS AND PHONE:
|
9 |
|
|
BRUCE SHERRY
|
10 |
|
|
1054 BLUEBELL DR.
|
11 |
|
|
LIVERMORE, CA. 94550
|
12 |
|
|
TEL (415) 443-9288
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
THE LANGUAGE
|
16 |
|
|
|
17 |
|
|
NUMBERS
|
18 |
|
|
|
19 |
|
|
IN TINY BASIC, ALL NUMBERS ARE INTEGERS AND MUST BE LESS THAN 32767.
|
20 |
|
|
|
21 |
|
|
VARIABLES
|
22 |
|
|
|
23 |
|
|
THERE ARE 26 VARIABLES DENOTED BY LETTERS A THROUGH Z. THERE IS ALSO A
|
24 |
|
|
SINGLE ARRAY @(I). THE DIMENSION OF THIS ARRAY (I.E., THE RANGE OF
|
25 |
|
|
VALUE OF THE INDEX I) IS SET AUTOMATICALLY TO MAKE USE OF ALL THE
|
26 |
|
|
MEMORY SPACE THAT IS LEFT UNUSED BY THE PROGRA. (I.E., 0 THROUGH SIZE/2,
|
27 |
|
|
SEE SIZE FINCTION BELOW.)
|
28 |
|
|
|
29 |
|
|
FINCTIONS
|
30 |
|
|
|
31 |
|
|
PRESENTLY THERE ARE 6 FUNCTIONS:
|
32 |
|
|
ABS(X) GIVES THE ABSOLUTE VALUE OF X.
|
33 |
|
|
RND(X) GIVES A RANDOM NUMBER BETWEEN 1 AND X (INCLUSIVE).
|
34 |
|
|
SIZE GIVES THE NUMBER OF BYTES LEFT UNUSED BY THE PROGRAM.
|
35 |
|
|
IT IS A TWO'S COMPLEMENT NUMBER SO IF IT IS
|
36 |
|
|
NEGATIVE IT IS ACTUALLY LARGER THAN 32767.
|
37 |
|
|
INP(X) GIVES THE VALUE (0 TO 255) OF INPUT PORT X
|
38 |
|
|
PEEK(X) GIVES THE VALUE OF MEMORY LOCATION X. TWO'S COMPLEMENT
|
39 |
|
|
AGAIN.
|
40 |
|
|
USR(X<,Y>) CALLS THE MACHINE LANGUAGE SUBROUTINE AT LOCATION X.
|
41 |
|
|
OPTIONAL PARAMETER Y IS PASSED IN H&L IF THERE AND THE
|
42 |
|
|
VALUE OF THE FUNCTION IS RETURNED IN H&L. THE PROGRAM
|
43 |
|
|
SAVES ALL REGISTERS, SO YOU DON'T HAVE TO.
|
44 |
|
|
|
45 |
|
|
ARITHMETIC AND COMPARE OPERATORS
|
46 |
|
|
|
47 |
|
|
/ DIVIDE. NOTE THAT SINCE WE HAVE INTEGERS ONLY, 2/3=0.
|
48 |
|
|
* MULTIPLY.
|
49 |
|
|
- SUBTRACT.
|
50 |
|
|
+ ADD.
|
51 |
|
|
> COMPARE IF GREATER THAN.
|
52 |
|
|
< COMPARE IF LESS THAN.
|
53 |
|
|
= COMPARE IF EQUAL TO. NOTE THAT TO CERTAIN VERSIONS OF
|
54 |
|
|
BASIC "LET A=B=0" MEANS "SET BOTH A AND B TO 0". TO
|
55 |
|
|
THIS VERSION OF TINY BASIC, IT MEAND "SET A TO THE
|
56 |
|
|
RESULT OF COMPARING B WITH 0".
|
57 |
|
|
# COMPARE IF NOT EQUAL TO.
|
58 |
|
|
>= COMPARE IF GREATER THAN OR EQUAL TO.
|
59 |
|
|
<= COMPARE IF LESS THAN OR EQUAL TO.
|
60 |
|
|
|
61 |
|
|
+, -, *, AND / OPERATIONS RESULT IN A VALUE OF BETWEEN -32767 AND
|
62 |
|
|
32767. (-32768 IS ALSO ALLOWED IN SOME CASES.) ALL COMPARE OPERATORS
|
63 |
|
|
RESULT IN A 1 IF TRUE AND A 0 IF NOT TRUE.
|
64 |
|
|
|
65 |
|
|
EXPRESSIONS
|
66 |
|
|
|
67 |
|
|
EXPRESSIONS ARE FORMED WITH NUMBERS, VARIABLES, AND FUNCTIONS WITH
|
68 |
|
|
ARITHMETIC AND COMPARE OPERATORS BETWEEN THEM. + AND - SIGNS CAN ALSO
|
69 |
|
|
BE USED AT THE BEGINNING OF AN EXPRESSION. THE VALUE OF AN
|
70 |
|
|
EXPRESSION IS EVALUATED FROM LEFT TO RIGHT, EXCEPT THAT * AND / ARE
|
71 |
|
|
ALWAYS DONE FIRST, AND THEN + AND - , AND THEN COMPARE OPERATORS.
|
72 |
|
|
PARENTHESES CAN ALSO BE USED TO ALTER THE ORDER OF EVALUATION.
|
73 |
|
|
|
74 |
|
|
STATEMENTS
|
75 |
|
|
|
76 |
|
|
A TINY BASIC STATEMENT CONSISTS OF A STATEMENT NUMBER BETWEEN 1 AND
|
77 |
|
|
32767 FOLLOWED BY ONE OR MORE COMMANDS. COMMANDS IN THE SAME STATEMENT
|
78 |
|
|
ARE SEPARATED BY A SEMI-COLON ";". "GOTO", "STOP", AND "RETURN" COMMANDS
|
79 |
|
|
MUST BE THE LAST COMMAND IN ANY GIVEN STATEMENT.
|
80 |
|
|
|
81 |
|
|
PROGRAM
|
82 |
|
|
|
83 |
|
|
A TINY BASIC PROGRAM CONSISTS OF ONE OR MORE STATEMENTS. WHEN A DIRECT
|
84 |
|
|
COMMAND "RUN" IS ISSUED, THE STATEMENT WITH THE LOWEST STATEMENT NUMBER
|
85 |
|
|
IS EXECUTED FORST, THE THE ONE WITH THE NEXT LOWEST STATEMENT NUMBER, ETC.
|
86 |
|
|
HOWEVER, THE "GOTO", "GOSUB", "STOP", AND "RETURN" COMMANDS CAN ALTER
|
87 |
|
|
THIS NORMAL SEQUENCE. WITHIN THE STATEMENT, EXECUTION OF COMMANDS IS
|
88 |
|
|
FROM LEFT TO RIGHT. THE "IF" COMMAND CAN CAUSE THE EXECUTION OF ALL THE
|
89 |
|
|
COMMANDS TO ITS RIGHT IN THE SAME STATEMENT TO BE SKIPPED OVER.
|
90 |
|
|
|
91 |
|
|
COMMANDS
|
92 |
|
|
|
93 |
|
|
TINY BASIC COMMANDS ARE LISTED BELOW WITH EXAMPLES. REMEMBER THAT
|
94 |
|
|
COMMANDS CAN BE CONCATENATED WITH SEMI-COLONS. IN ORDER TO STORE THE
|
95 |
|
|
STATEMENT, YOU MUST ALSO HAVE A STATEMENT NUMBER IN FRONT OF THE
|
96 |
|
|
COMMANDS. THE STATEMENT NUMBER AND THE CONCATENATION ARE NOT SHOWN
|
97 |
|
|
IN THE EXAMPLES.
|
98 |
|
|
|
99 |
|
|
REM OR REMARK COMMAND
|
100 |
|
|
|
101 |
|
|
REM ANYTHING GOES
|
102 |
|
|
|
103 |
|
|
THIS LINE WILL BE IGNORED BY TBI.
|
104 |
|
|
|
105 |
|
|
LET COMMAND
|
106 |
|
|
|
107 |
|
|
LET A=234-5*6, A=A/2, X=A-100, @(X+9)=A-1
|
108 |
|
|
|
109 |
|
|
WILL SET THE VARIABLE A TO THE VALUE OF THE EXPRESSION 234-5*6 (I.E. 204),
|
110 |
|
|
SET THE VARIABLE A (AGAIN) TO THE VALUE OF THE EXPRESSION A/2 (I.E. 102),
|
111 |
|
|
SET THE VARIABLE X TO THE VALUE OF THE EXPRESSION A=100 (I.E. 2), AND
|
112 |
|
|
THEN SET THE VARIABLE @(11) TO 101 (WHERE 11 IS THE VALUE OF THE
|
113 |
|
|
EXPRESSION AX+9 AND 101 IS THE VALUE OF THE EXPRESSION A-1).
|
114 |
|
|
|
115 |
|
|
LET U=A#B, V=(A>B)*X+(A
|
116 |
|
|
|
117 |
|
|
WILL SET THE VARIABLE U TO EITHER 1 OR 0 DEPENDING ON WHETHER A IS NOT
|
118 |
|
|
EQUAL TO OR IS EQUAL TO B; AND SET THE VARIABLE V TO EITHER X, Y OR 0
|
119 |
|
|
DEPENDING ON WHETHER A IS GREATER THAN, LESS THAN, OR EQUAL TO B.
|
120 |
|
|
|
121 |
|
|
PRINT COMMAND
|
122 |
|
|
|
123 |
|
|
PRINT
|
124 |
|
|
|
125 |
|
|
WILL CAUSE A CARRIAGE-RETURN (CR) AND A LINE-FEED (LF) ON THE OUTPUT
|
126 |
|
|
DEVICE.
|
127 |
|
|
|
128 |
|
|
PRINT A*3+1, "ABC 123 !@#", ' CBA '
|
129 |
|
|
|
130 |
|
|
WILL PRINT THE VALUE OF THE EXPRESSION A*3+1 (I.E. 307), THE STRING
|
131 |
|
|
OF CHARACTERS "ABC 123 !@#" AND THE STRING" CBA ", AND THEN A
|
132 |
|
|
CR-LF. NOTE THAT EITHER SINGLE OR DOUBLE QUOTES CAN BE USED TO QUOTE
|
133 |
|
|
STRINGS, BUT PAIRS MUST BE MATCHED.
|
134 |
|
|
|
135 |
|
|
PRINT A*3+1, "ABC 123 !@#", ' CBA ',
|
136 |
|
|
|
137 |
|
|
WILL PRODUCE THE SAME OUTPUT AS BEFORE, EXCEPT THAT THERE IS NO CR-LF
|
138 |
|
|
AFTER THE LAST ITEM IS PRINTED, THIS ENABLES THE PROGRAM TO CONTINUE
|
139 |
|
|
PRINTING ON THE SAME LINE WITH ANOTHER "PRINT".
|
140 |
|
|
|
141 |
|
|
PRINT A, B, #3, C, D, E, #10, F, G
|
142 |
|
|
|
143 |
|
|
WILL PRINT THE VALUES OF A AND B IN 6 SPACES, THE VALUES OF C, D, AND
|
144 |
|
|
E IN 3 SPACES, AND THE VALUES OF A AND G IN 10 SPACES. IF THERE ARE
|
145 |
|
|
NOT ENOUGH SPACES SPECIFIED FOR A GIVEN VALUE TO BE PRINTED, THE VALUE
|
146 |
|
|
WILL BE PRINTED WITH ENOUGH SPACES ANYWAY.
|
147 |
|
|
|
148 |
|
|
PRINT 'ABC',_,'XXX'
|
149 |
|
|
|
150 |
|
|
WILL PRINT THE STRING "ABC", A CR WITHOUT A LF, AND THEN THE STRING
|
151 |
|
|
"XXX" (OVER THE ABC) FOLLOWED BY A CR-LF.
|
152 |
|
|
|
153 |
|
|
INPUT COMMAND
|
154 |
|
|
|
155 |
|
|
INPUT A, B
|
156 |
|
|
|
157 |
|
|
WHEN THES COMMAND IS EXECUTED, TINY BASIC WILL PRINT "A:" AND WAIT TO
|
158 |
|
|
READ IN AN EXPRESSION FROM THE INPUT DEVICE. THE VARIABLE A WILL BE
|
159 |
|
|
SET TO THE VALUE OF THES EXPRESSION. THEN "B:" IS PRINTED AND VARIABLE
|
160 |
|
|
B IS SET TO THE VALUE OF THE NEXT EXPRESSION READ FROM THE INPUT DEVICE.
|
161 |
|
|
NOTE THAT NOT ONLY NUMBERS, BUT ALSO EXPRESSIONS CAN BE READ AS INPUT.
|
162 |
|
|
|
163 |
|
|
INPUT 'WHAT IS THE WEIGHT'A, "AND SIZE"B
|
164 |
|
|
THIS IS THE SAVE AS THE COMMAND ABOVE, EXCEPT THE PROMPT "A:" IS REPLACED
|
165 |
|
|
BY "WHAT IS THE WEIGHT:" AND THE PROMPT "B:" IS REPLACED WITH "AND
|
166 |
|
|
SIZE:". AGAIN, BOTH SINGLE AND DOUBLE QUOTES CAN BE USED AS LONG AS
|
167 |
|
|
THEY ARE MATCHED.
|
168 |
|
|
|
169 |
|
|
INPUT A, 'STRING',_, "ANOTHER STRING", B
|
170 |
|
|
|
171 |
|
|
THE SRINGS AND THE "_" HAVE THE SAVE EFFECT AS IN "PRINT".
|
172 |
|
|
|
173 |
|
|
OUT COMMAND
|
174 |
|
|
|
175 |
|
|
OUT 2, A+5, 6, B/7
|
176 |
|
|
|
177 |
|
|
WILL CAUSE THE LEAST SIGNIFICANT BYTE OF THE EXPRISSION "A+5" TO BE
|
178 |
|
|
OUTPUT TO PORT 2, AND THEN THE LEAST SIGNIFICANT BYTE OF THE EXPRESSION
|
179 |
|
|
"B/7" WILL BE OUTPUT TO PORT 6.
|
180 |
|
|
|
181 |
|
|
OUT X+Y,Z
|
182 |
|
|
|
183 |
|
|
THIS OUTPUTS THE VALUE OF Z (L.S. BYTE) TO THE PORT SPECIFIED BY THE
|
184 |
|
|
EXPRESSION "X+Y"
|
185 |
|
|
|
186 |
|
|
WAIT COMMAND
|
187 |
|
|
|
188 |
|
|
WAIT I,J
|
189 |
|
|
|
190 |
|
|
THIS READS THE STATUS OF PORT "I" AND MASKS THIS WITH "J" BY WAY OF A
|
191 |
|
|
"LOGICAL AND". IT WILL CONTINUE READING UNTIL THE RESULT OF THE "AND"
|
192 |
|
|
IS NOT EQUAL TO ZERO.
|
193 |
|
|
|
194 |
|
|
WAIT I,J,K
|
195 |
|
|
|
196 |
|
|
THIS IS THE SAME AS BEFORE EXCEPT THAT THE STATUS IS LOGICALLY EXCLUSIVE
|
197 |
|
|
OR'ED WITH "K" BEFORE THE MASK TO INVERT BITS IF NECCESSARY.
|
198 |
|
|
|
199 |
|
|
POKE COMMAND
|
200 |
|
|
|
201 |
|
|
POKE 4000+X,Y
|
202 |
|
|
|
203 |
|
|
THIS COMMAND WORKS JUST LIKE OUT, EXCEPT THAT EXPRESSION "Y" IS WRITTEN
|
204 |
|
|
INTO MEMORY LOCATION SPECIFIED BY THE EXPRESSION "4000+X".
|
205 |
|
|
|
206 |
|
|
IF COMMAND
|
207 |
|
|
|
208 |
|
|
IF A
|
209 |
|
|
|
210 |
|
|
WILL THES THE VALUE OF THE EXPRESSION A
|
211 |
|
|
IS TRUE), THE COMMANDS IN THE REST OF THIS STATEMENT WILL BE EXECUTED.
|
212 |
|
|
IF THE VALUE OF THE EXPRESSION IS ZERO (I.E. IF IT IS NOT TRUE), THE REST
|
213 |
|
|
OF THIS STATEMENT WILL BE SKIPPED OVER AND EXECUTION CONTINUES AT THE
|
214 |
|
|
NEXT STATEMENT. NOTE THAT THE WORD "THEN" IS NOT USED.
|
215 |
|
|
|
216 |
|
|
GOTO COMMAND
|
217 |
|
|
|
218 |
|
|
GOTO 120
|
219 |
|
|
|
220 |
|
|
WILL CAUSE THE EXECUTION TO JUMP TO STATEMENT 120. NOTE THAT "GOTO"
|
221 |
|
|
COMMAND CANNOT BE FOLLOWED BY A SEMI-COLON AND OTHER COMMANDS.
|
222 |
|
|
IT MUST BE ENDED WITH A CR.
|
223 |
|
|
|
224 |
|
|
GOTO A*10+B
|
225 |
|
|
|
226 |
|
|
WILL CAUSE THE EXECUTION TO JUMP TO A DIFFERENT STATEMENT NUMBER AS
|
227 |
|
|
COMPUTED FROM THE VALUE OF THE EXPRESSION.
|
228 |
|
|
|
229 |
|
|
GOSUB AND RETURN COMMANDS
|
230 |
|
|
|
231 |
|
|
GOSUB 120
|
232 |
|
|
|
233 |
|
|
WILL CAUSE THE EXECUTION TO JUMP TO STATEMENT 120.
|
234 |
|
|
|
235 |
|
|
GOSUB A*10+B
|
236 |
|
|
|
237 |
|
|
WILL CAUSE THE EXECUTION TO JUMP TO DIFFERENT STATEMENTS AS COMPUTED
|
238 |
|
|
FROM THE VALUE OF THE EXPRESSION A*10+B.
|
239 |
|
|
|
240 |
|
|
RETURN
|
241 |
|
|
|
242 |
|
|
A RETURN COMMAND MUST BE THE LAST COMMAND IN A STATEMENT AND BE FOLLOWED
|
243 |
|
|
BY A CR. WHEN A RETURN COMMAND IS ENCOUNTERED, IT WILL CAUSE THE EXECUTION
|
244 |
|
|
TO JUMP BACK TO THE COMMAND FOLLOWING THE MOST RECENT GOSUB COMMAND.
|
245 |
|
|
|
246 |
|
|
GOSUB CAN BE NESTED. THE DEPTH OF NESTING IS LIMITED ONLY BY THE STACK
|
247 |
|
|
SPACE.
|
248 |
|
|
|
249 |
|
|
FOR AND NEXT COMMANDS
|
250 |
|
|
|
251 |
|
|
FOR X=A+1 TO 3*B STEP C-1
|
252 |
|
|
|
253 |
|
|
THE VARIABLE X IS SET TO THE VALUE OF THE EXPRESSION A+1. THE VALUES OF
|
254 |
|
|
THE EXPRESSIONS (NOT THE EXPRESSIONS THEMSELVES) 3*B AND C-1 ARE REM-
|
255 |
|
|
BERED. THE NAME OF THE VARIABLE X, THE STATEMENT NUMBER AND THE
|
256 |
|
|
POSITION OF THIS COMMAND WITHIN THE STATEMENT ARE ALSO REMEMBERED.
|
257 |
|
|
EXECUTION THEN CONTINUES THE NORMAL WAY UNTIL A NEXT COMMAND IS
|
258 |
|
|
ENCOUNTERED.
|
259 |
|
|
|
260 |
|
|
THE STEP CAN BE POSITIVE, NEGATIVE OR EVEN ZERO. THE WORD STEP AND THE
|
261 |
|
|
EXPRESSION FOLLOWING IT CAN BE OMITTED IF THE DESIRED STEP IS +1.
|
262 |
|
|
|
263 |
|
|
NEXT X
|
264 |
|
|
|
265 |
|
|
THE NAME OF THE VARIABLE (X) IS CHECKED WITH THAT OF THE MOST RECENT FOR
|
266 |
|
|
COMMAND. IF THEY DO NOT AGREE, THAT FOR IS TERMINATED AND THE NEXT RECENT
|
267 |
|
|
FOR IS CHECKED, ETC. WHEN A MATCH IS FOUND, THIS VARIABLE WILL BE SET TO
|
268 |
|
|
ITS CURRENT VALUE PLUS THE VALUE OF THE STEP EXPRESSION SAVED BY THE FOR
|
269 |
|
|
COMMAND. THE UPDATED VALUE IS THEN COMPARED WITH THE VALUE OF THE TO
|
270 |
|
|
EXPRESSION ALSO SAVED BY THE FOR COMMAND. IF THIS WITHIN THE LIMIT,
|
271 |
|
|
EXECUTION WILL JUMP BACK TO THE COMMAND FOLLOWING THE FOR COMMAND. IF
|
272 |
|
|
THIS IS OUTSIDE THE LIMIT, EXECUTION CONTINUES FOLLOWING THE NEXT COMMAND
|
273 |
|
|
ITSELF.
|
274 |
|
|
|
275 |
|
|
FOR CAN BE NEXTED. THE DEPTH OF NESTING IS LINITED ONLY BY THE STACK
|
276 |
|
|
SPACE. IF A NEW FOR COMMAND WITH THE SAME CONTROL VARIABLE AS THAT OF AN
|
277 |
|
|
OLD FOR COMMAND IS ENCOUNTERED, THE OLD FOR WILL BE TERMINATED AUTOMATIC-
|
278 |
|
|
ALLY.
|
279 |
|
|
|
280 |
|
|
STOP COMMAND
|
281 |
|
|
|
282 |
|
|
STOP
|
283 |
|
|
|
284 |
|
|
THIS COMMAND STOPS THE EXECUTION OF THE PROGRAM AND RETURNS CONTROL TO
|
285 |
|
|
DIRECT COMMANDS FROM THE INPUT DEVICE. IT CAN APPEAR MANY TIMES IN A
|
286 |
|
|
PROGRAM BUT MUST BE THE LAST COMMAND IN ANY GIVEN STATEMENT. I.E. IT
|
287 |
|
|
CANNOT BE FOLLOWED BY A SEMI-COLON AND OTHER COMMANDS.
|
288 |
|
|
|
289 |
|
|
DIRECT COMMANDS
|
290 |
|
|
|
291 |
|
|
AS DEFINED EARLIER, A STATEMENT CONSISTS OF A STATEMENT NUMBER FOLLWOED
|
292 |
|
|
BY COMMANDS. IF THE STATEMENT NUMBER IS MISSING, OR IF IT IS 0, THE
|
293 |
|
|
COMMANDS WILL BE EXECUTED AFTER YOU HAVE YPED THE CR. ALL THE COMMANDS
|
294 |
|
|
DESCRIBED ABOVE CAN BE USED AS DIRECT COMMANDS. THERE ARE SIX MORE
|
295 |
|
|
COMMANDS THAT CAN BE USED AS DIRECT COMMANDS BUT NOT AS PART OF A
|
296 |
|
|
STATEMENT.
|
297 |
|
|
|
298 |
|
|
RUN
|
299 |
|
|
|
300 |
|
|
WILL START TO EXECUTE THE PROGRAM STARTING AT THE LOWEST STATEMENT
|
301 |
|
|
NUMBER.
|
302 |
|
|
|
303 |
|
|
LIST
|
304 |
|
|
|
305 |
|
|
WILL PRINT OUT ALL THE STATEMENTS IN NUMERICAL ORDER.
|
306 |
|
|
|
307 |
|
|
LIST 120
|
308 |
|
|
|
309 |
|
|
WILL PRINT OUT ALL THE STATEMENTS IN NUMERICAL ORDER STARTING AT
|
310 |
|
|
STATEMENT 120.
|
311 |
|
|
|
312 |
|
|
NEW
|
313 |
|
|
|
314 |
|
|
WILL DELETE ALL THE STATEMENTS.
|
315 |
|
|
|
316 |
|
|
SAVE STARTREK
|
317 |
|
|
|
318 |
|
|
WILL SAVE THE PRESENT PROGRAM ON DISK BY WAY OF THE CPM OPERATING
|
319 |
|
|
SYSTEM. IT WILL BE SAVED AS A FILE NAMED "STARTREK.TBI". THIS
|
320 |
|
|
IS NOT A PURE ASCII FILE AS THE LINE NUMBERS ARE STORED IN BINARY.
|
321 |
|
|
|
322 |
|
|
LOAD STARTREK
|
323 |
|
|
|
324 |
|
|
WILL DELETE ANY PROGRAM IN MEMORY AND WILL LOAD IN A FILE FROM DISK
|
325 |
|
|
CALLED "STARTREK.TBI", IF IT EXISTS.
|
326 |
|
|
|
327 |
|
|
BYE
|
328 |
|
|
|
329 |
|
|
WILL RETURN YOU TO THE CPM OPERATING SYSTEM.
|
330 |
|
|
|
331 |
|
|
STOPPING THE EXECUTION
|
332 |
|
|
|
333 |
|
|
THE EXECUTION OF PROGRAM OR LISTION OF PROGRAM CAN BE STOPPED BY THE
|
334 |
|
|
CONTROL-C KEY ON THE INPUT DEVICE.
|
335 |
|
|
|
336 |
|
|
ABBREVIATION AND BLANKS
|
337 |
|
|
|
338 |
|
|
YOU MAY USE BLANKS FREELY, EXCEPT THAT NUMBERS, COMMAND KEY WORDS, AND
|
339 |
|
|
FUNCTION NAMES CANNOT HAVE EMBEDDED BLANKS.
|
340 |
|
|
|
341 |
|
|
YOU CAN TRUNCATE ALL COMMAND KEY WORDS AND FUNCTION NAMES AND FOLLOW
|
342 |
|
|
EACH BY A PERIOD. "PR.", "PRI.", "PRIN." ALL STAND FOR "PRINT".
|
343 |
|
|
ALSO THE WORD LET IN LET COMMANDS MAY BE OMITTED. THE "SHORTEST"
|
344 |
|
|
ABBREVIATION FOR ALL THE KEY WORDS ARE AS FOLLOWS:
|
345 |
|
|
A.=ABS F.=FOR GOS.=GOSUB G.=GOTO
|
346 |
|
|
IF=IF I.=INP IN.=INPUT L.=LIST
|
347 |
|
|
LO.=LOAD N.=NEW N.=NEXT O.=OUTPUT
|
348 |
|
|
P.=PEEK P.=POKE PR.=PRINT REM=REMARK
|
349 |
|
|
R.=RETURN R.=RND R.=RUN S.=SAVE
|
350 |
|
|
S.=SIZE S.=STEP S.=STOP TO=TO
|
351 |
|
|
U.=USR W.=WAIT
|
352 |
|
|
NULL AND NONE-OF-THE-ABOVE = LET
|
353 |
|
|
|
354 |
|
|
ERROR REPORT
|
355 |
|
|
|
356 |
|
|
THERE ARE ONLY THREE ERROR CONDITIONS IN TINY BASIC. THE STATEMENT WITH
|
357 |
|
|
THE ERROR IS PRINTED OUT WITH A QUESTION MARK INSERTED AT THE POINT
|
358 |
|
|
WHERE THE ERROR IS DETECTED.
|
359 |
|
|
|
360 |
|
|
(1) WHAT? MEANS IT DOES NOT UNDERSTAND YOU. EXAMPLE:
|
361 |
|
|
|
362 |
|
|
WHAT?
|
363 |
|
|
260 LET A=B+3, C=(3+4?. X=4
|
364 |
|
|
|
365 |
|
|
HOW?
|
366 |
|
|
210 P?TINT "THIS" WHERE PRINT IS MISSTYPED
|
367 |
|
|
|
368 |
|
|
(2) HOW? MEANS IT UNDERSTANDS YOU BUT DOES NOT KNOW HOW TO DO IT.
|
369 |
|
|
|
370 |
|
|
HOW?
|
371 |
|
|
310 LET A=B*C?+2 WHERE B*C IS LARGER THAN 32767
|
372 |
|
|
|
373 |
|
|
HOW?
|
374 |
|
|
380 GOTO 412? WHERE 412 DOES NOT EXIST
|
375 |
|
|
|
376 |
|
|
(3) SORRY? MEANS IT UNDERSTANDS YOU AND KNOWS HOW TO DO IT BUT THERE
|
377 |
|
|
IS NOT ENOUGH MEMORY TO DO IT.
|
378 |
|
|
|
379 |
|
|
ERROR CORRECTIONS
|
380 |
|
|
|
381 |
|
|
IF YOU NOTICE AN ERROR IN TYPEIN BEFORE YOU HIT THE CR, YOU CAN DELETE
|
382 |
|
|
THE LAST CHARACTER BY THE RUB-OUT KEY OR DELETE THE ENTIRE LINE BY THE
|
383 |
|
|
"\" KEY. TINY BASIC WILL ECHO A BACK ARROW "_" FOR EACH RUB-OUT.
|
384 |
|
|
ECHO FOR BACK-SLASH CONSISTS OF A LF, A CR, AND AN UP ARROW.
|
385 |
|
|
|
386 |
|
|
TO CORRECT A STATEMENT, YOU CAN RETYPE THE STATEMENT NUMBER AND THE
|
387 |
|
|
CORRECT COMMANDS. TINY BASIC WILL TRPLACE THE OLD STATEMENT WITH THE NEW
|
388 |
|
|
ONE.
|
389 |
|
|
|
390 |
|
|
TO DELETE A STATEMENT, TYPE THE STATEMENT NUMBER AND A CR ONLY.
|
391 |
|
|
|
392 |
|
|
VERIVY THE CORRECTIONS BY "LIST NNNN" AND HIT THE CONTROL-C KEY WHILE
|
393 |
|
|
THE LINE IS BEING PRINTED.
|