Microsoft BASIC compiler v5.36
This commit is contained in:
parent
30f28666d8
commit
b591749377
3
Microsoft BASIC Compiler v5.36/B.CNF
Normal file
3
Microsoft BASIC Compiler v5.36/B.CNF
Normal file
@ -0,0 +1,3 @@
|
||||
modules=sample.mod
|
||||
precision=14
|
||||
|
BIN
Microsoft BASIC Compiler v5.36/B.DEF
Normal file
BIN
Microsoft BASIC Compiler v5.36/B.DEF
Normal file
Binary file not shown.
BIN
Microsoft BASIC Compiler v5.36/BASCOM.COM
Normal file
BIN
Microsoft BASIC Compiler v5.36/BASCOM.COM
Normal file
Binary file not shown.
BIN
Microsoft BASIC Compiler v5.36/BASCOM.LIB
Normal file
BIN
Microsoft BASIC Compiler v5.36/BASCOM.LIB
Normal file
Binary file not shown.
BIN
Microsoft BASIC Compiler v5.36/BASRUN.EXE
Normal file
BIN
Microsoft BASIC Compiler v5.36/BASRUN.EXE
Normal file
Binary file not shown.
BIN
Microsoft BASIC Compiler v5.36/BASRUN.LIB
Normal file
BIN
Microsoft BASIC Compiler v5.36/BASRUN.LIB
Normal file
Binary file not shown.
38
Microsoft BASIC Compiler v5.36/BB.TXT
Normal file
38
Microsoft BASIC Compiler v5.36/BB.TXT
Normal file
@ -0,0 +1,38 @@
|
||||
10 DEFINT A-Z
|
||||
20 DIM FLAGS(8191)
|
||||
30 PRINT "Only 1 Iteration"
|
||||
40 COUNT=0
|
||||
50 FOR I=0 TO 8190
|
||||
60 FLAGS(I)=1
|
||||
70 NEXT
|
||||
80 FOR I=0 TO 8190
|
||||
90 IF FLAGS(I) =0 THEN GOTO 170
|
||||
100 PRIME=I+I+3
|
||||
110 K=I+PRIME
|
||||
120 WHILE K <= 8190
|
||||
130 FLAGS(K)=0
|
||||
140 K=K+PRIME
|
||||
150 WEND
|
||||
160 COUNT=COUNT+1
|
||||
170 NEXT
|
||||
180 PRINT COUNT;" primes"
|
||||
|
||||
|
||||
INTEGER: Count,Prime,K,I
|
||||
INTEGER ARRAY(8191): Flags
|
||||
CONSTANT: Siz=8190
|
||||
10 PRINT "Only 1 Iteration"
|
||||
20 CLEAR(Flags,Count)
|
||||
30 FOR I=0 TO Siz
|
||||
40 DO IF NOT(Flags(I))
|
||||
50 Prime=I+I+3
|
||||
60 K=I+Prime
|
||||
70 WHILE K <= Siz DO
|
||||
80 Flags(K)=-1
|
||||
90 K=K+Prime
|
||||
100 REPEAT
|
||||
110 Count=Count+1
|
||||
120 END DO
|
||||
130 NEXT
|
||||
140 PRINT Count;" primes"
|
||||
|
15
Microsoft BASIC Compiler v5.36/DEMO.BAS
Normal file
15
Microsoft BASIC Compiler v5.36/DEMO.BAS
Normal file
@ -0,0 +1,15 @@
|
||||
10 ' $TITLE : 'MS-BASIC' $SUBTITLE : 'Program'
|
||||
20 DEFINT A-Z
|
||||
30 DIM A(10,10),B(10,10),C(10,10)
|
||||
40 PRINT "Start of program"
|
||||
50 ' $OCODE +
|
||||
60 FOR I=1 TO 10
|
||||
70 FOR J=1 TO 10
|
||||
80 A(I,J) = A(I-1,J-1)+B(I,J)*C(I,J)
|
||||
90 NEXT
|
||||
100 NEXT
|
||||
110 ' $OCODE -
|
||||
120 PRINT "End of Program"
|
||||
130 END
|
||||
|
||||
|
44
Microsoft BASIC Compiler v5.36/FOO
Normal file
44
Microsoft BASIC Compiler v5.36/FOO
Normal file
@ -0,0 +1,44 @@
|
||||
SOURCE
|
||||
PRECISION 14
|
||||
PROCS=3
|
||||
REAL: X
|
||||
|
||||
PROCEDURE: Bell
|
||||
END PROCEDURE
|
||||
|
||||
PROCEDURE: Plot
|
||||
INTEGER ARG: X
|
||||
END PROCEDURE
|
||||
|
||||
REAL FUNCTION: Double
|
||||
REAL ARG: X
|
||||
END FUNCTION
|
||||
|
||||
PROCEDURE: Bell
|
||||
10 PRINT CHR$(7);
|
||||
END PROCEDURE
|
||||
|
||||
PROCEDURE: Plot
|
||||
10 DO X TIMES
|
||||
20 PRINT " ";
|
||||
30 REPEAT
|
||||
40 PRINT "*"
|
||||
END PROCEDURE
|
||||
|
||||
REAL FUNCTION: Double
|
||||
10 IF X<0 THEN ERROR 555
|
||||
20 RESULT=X*2
|
||||
END FUNCTION
|
||||
|
||||
'MAIN Program:
|
||||
|
||||
|
||||
5 DO 3 TIMES
|
||||
8 Bell
|
||||
10 FOR X=1 TO 16
|
||||
20 Plot Double(X)
|
||||
40 NEXT
|
||||
50 REPEAT
|
||||
|
||||
ENDFILE
|
||||
|
BIN
Microsoft BASIC Compiler v5.36/LINK.EXE
Normal file
BIN
Microsoft BASIC Compiler v5.36/LINK.EXE
Normal file
Binary file not shown.
96
Microsoft BASIC Compiler v5.36/SAMPLE.1
Normal file
96
Microsoft BASIC Compiler v5.36/SAMPLE.1
Normal file
@ -0,0 +1,96 @@
|
||||
=,3,1,14,14,1,14,1
|
||||
5,15,18,64,1,,F
|
||||
%
|
||||
6,18,17,61,0,Welcome to BetterBASIC,F
|
||||
|
||||
We are happy to provide you with this
|
||||
sample of the BetterBASIC Programming
|
||||
System. It allows you to explore the
|
||||
many new features of BetterBASIC.
|
||||
|
||||
!The control program which is the heart
|
||||
!of this sample was, of course, written
|
||||
!in BetterBASIC.
|
||||
%
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,0,3,1,14,1,12,0
|
||||
0,0,15,79,0,About this Sample Diskette,F
|
||||
|
||||
With the purchase of this sample diskette you have taken the first step
|
||||
towards the discovery of BetterBASIC, a new and exciting programming system,
|
||||
which renders your old BASIC more obsolete than ever.
|
||||
|
||||
Rather than just provide you with a stunted version of BetterBASIC and leave
|
||||
you to ferret out BetterBASIC's features and benefits for yourself, we have
|
||||
designed this sample to convey as much information as possible about
|
||||
BetterBASIC.
|
||||
|
||||
!If you like BetterBASIC, please feel free to make copies of this sample for
|
||||
!your friends. If you don't like BetterBASIC, let us know why !!
|
||||
%
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,1,3,15,14,1,12,0
|
||||
6,10,14,69,0,The Sample Programs,F
|
||||
|
||||
This diskette contains a sample version of BetterBASIC.
|
||||
It also contains a series of menu-driven demos,
|
||||
tutorials and information programs which you can explore
|
||||
at your leisure. The following is provided:
|
||||
%
|
||||
6,10,14,69,0,The BetterBASIC Demo,F
|
||||
|
||||
This program demonstrates some of BetterBASIC's
|
||||
capabilities, showing you windows and graphics (if you
|
||||
have the Graphics Adaptor) as well as many other
|
||||
BetterBASIC capabilities.
|
||||
%
|
||||
6,10,14,69,0,The BetterBASIC Tutorial,F
|
||||
|
||||
Following an introduction to BetterBASIC's most unique
|
||||
features, we give you a series of interactive hands-on
|
||||
tutorials designed to introduce you to programming
|
||||
language features not found in any other BASICs.
|
||||
%
|
||||
6,10,14,69,0,Microsoft BASIC Comparisons,F
|
||||
|
||||
|
||||
This program gives you a comparison of BetterBASIC and
|
||||
Microsoft BASIC features.
|
||||
|
||||
%
|
||||
6,10,14,69,0,Compatibility Issues,F
|
||||
|
||||
This program briefly summarizes differences between the
|
||||
BetterBASIC and Microsoft BASIC lamguages to help you
|
||||
convert Microsoft BASIC programs to BetterBASIC.
|
||||
|
||||
%
|
||||
6,10,14,69,0,The on-disk Manual,F
|
||||
|
||||
This program provides information about the on-disk
|
||||
Abbreviated User's Manual which is included on this
|
||||
sample diskette.
|
||||
|
||||
%
|
||||
6,10,14,69,0,The BetterBASIC Product Line,F
|
||||
|
||||
|
||||
Here we provide a description of Summit Software
|
||||
Technology, Inc.'s current BetterBASIC products.
|
||||
|
||||
%
|
||||
6,10,19,69,0,The MENU,F
|
||||
|
||||
Next you will see a menu which allows you to select
|
||||
which of the various BetterBASIC sample programs you
|
||||
wish to explore.
|
||||
|
||||
When using this sample in the future, you may by-pass
|
||||
this introductory section by hitting the [Esc] key which
|
||||
will take you directly to the Menu.
|
||||
|
||||
! We hope you enjoy BetterBASIC !!
|
||||
#
|
||||
|
330
Microsoft BASIC Compiler v5.36/SAMPLE.2
Normal file
330
Microsoft BASIC Compiler v5.36/SAMPLE.2
Normal file
@ -0,0 +1,330 @@
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,7,1,14,12,0,1,7
|
||||
3,10,16,69,0,The BetterBASIC Tutorial,F
|
||||
|
||||
The BetterBASIC tutorial consists of two parts.
|
||||
|
||||
Part 1 provides a series of descriptions of BetterBASIC
|
||||
which you should read the first time you use this
|
||||
tutorial.
|
||||
|
||||
Part 2 consists of interactive, hands-on lessons which
|
||||
let you explore some of the more unique features of
|
||||
BetterBASIC
|
||||
|
||||
! Use [Esc] to skip Part 1
|
||||
%
|
||||
=,7,1,15,15,4,12,0
|
||||
0,0,20,75,0,The PASCAL Dilemma,F
|
||||
|
||||
Finally there is an answer to the BASIC programmer's PASCAL-dilemma: To
|
||||
throw away years of experience in BASIC and learn PASCAL (or MODULA 2 or
|
||||
C), or to stay with the aging, virtually obsolete BASIC you are now
|
||||
using. The answer is:
|
||||
BetterBASIC
|
||||
|
||||
BetterBASIC, a revolutionary Programming System from Summit Software
|
||||
Technology Inc. has been specifically designed to offer BASIC
|
||||
programmers all of the most useful features of PASCAL, MODULA 2 and C,
|
||||
without the painful un-learning and re-learning processes associated
|
||||
with these non-interactive languages.
|
||||
|
||||
The base-level of BetterBASIC has been carefully modeled after Microsoft
|
||||
BASIC, the de-facto industry standard of the microcomputer industry. At
|
||||
this level, you can use BetterBASIC as though you were using your old
|
||||
and primitive BASIC.
|
||||
%
|
||||
=,0,7,1,12,0,0,3
|
||||
3,4,23,79,0,BetterBASIC Solves the PASCAL Dilemma,F
|
||||
|
||||
Now, for the first time, BetterBASIC offers existing BASIC programmers
|
||||
the following up-to-date programming language features:
|
||||
|
||||
! * RECORD and POINTER Data Types
|
||||
! * BLOCK STRUCTURE
|
||||
! * PROCEDURES and FUNCTIONS
|
||||
! * ARGUMENT VALIDATION
|
||||
! * OPTIONAL ARGUMENTS
|
||||
! * LOCAL VARIABLES
|
||||
! * LOCAL LINE NUMBERS
|
||||
! * RECURSION
|
||||
! * SEPARATELY COMPILED MODULES
|
||||
! * LANGUAGE EXTENDABILITY (Make your own BASIC!!)
|
||||
! * CLEAN ASSEMBLY LANGUAGE INTERFACE
|
||||
! * BUILT-IN LINKER
|
||||
! * BUILT-IN CROSS REFERENCE UTILITY
|
||||
%
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,1,7,0,7,0,14,1
|
||||
0,20,15,79,0,NEW DATA TYPES,F
|
||||
|
||||
! BetterBASIC supports the following Data Types:
|
||||
|
||||
* BYTE, INTEGER
|
||||
* REAL, Variable Precision Decimal
|
||||
High Speed Binary Math,
|
||||
or 8087 format
|
||||
* STRING to 32767 characters in length
|
||||
* RECORD containing FIELDS of any type
|
||||
* N-dimensional ARRAYS of any type
|
||||
* ARRAYS of ARRAYS
|
||||
* POINTER of any type
|
||||
%
|
||||
=,0,7,0,12,7,15,0
|
||||
5,25,13,74,0,BYTE,F
|
||||
|
||||
|
||||
Small integer in the range 0 ... 255
|
||||
|
||||
%
|
||||
5,25,13,74,0,INTEGER,F
|
||||
|
||||
|
||||
Integer in the range -32768 ... +32767
|
||||
|
||||
%
|
||||
5,25,13,74,0,REAL,F
|
||||
|
||||
Decimal Math Package:
|
||||
|
||||
Number in the range
|
||||
0.1E-254 to 9.9999...E+253
|
||||
From 6 to 24 digits of accuracy
|
||||
%
|
||||
5,25,13,74,0,REAL,F
|
||||
|
||||
High Speed Binary Math Package:
|
||||
|
||||
Much higher speed but less accuracy
|
||||
than Decimal Math Package:
|
||||
|
||||
6-1/2 or 14 digits of precision
|
||||
%
|
||||
5,25,13,74,0,REAL,F
|
||||
|
||||
8087 Math Package:
|
||||
|
||||
8087 format and numeric range
|
||||
|
||||
6-1/2 or 14 digits of precision
|
||||
%
|
||||
5,25,13,74,0,STRING,F
|
||||
|
||||
BetterBASIC can handle strings up to 32767
|
||||
characters in length. New string processing
|
||||
instructions are provided for case
|
||||
conversion, text insert and delete, and so
|
||||
on.
|
||||
%
|
||||
5,25,13,74,0,RECORD VARIABLES,F
|
||||
|
||||
A Record Variable is a variable containing
|
||||
other variables which can be of any type
|
||||
including even ARRAYS, other RECORDS or
|
||||
POINTERS to other Records.
|
||||
%
|
||||
5,25,13,74,0,ARRAYS,F
|
||||
|
||||
BetterBASIC supports N-dimensional arrays of
|
||||
all data types, including arrays of records
|
||||
and arrays of arrays.
|
||||
|
||||
%
|
||||
5,25,13,74,0,POINTERS,F
|
||||
|
||||
BetterBASIC also provides POINTER variables.
|
||||
A pointer is a named variable of a given
|
||||
type which can be SET to point to any other
|
||||
variable of the same type. Pointers are of
|
||||
great value in STRING and RECORD processing.
|
||||
|
||||
%
|
||||
=,1,7,0,7,0,14,1
|
||||
2,15,17,74,0,BLOCK STRUCTURE,F
|
||||
|
||||
BetterBASIC Block Structures have the following
|
||||
properties:
|
||||
|
||||
* Automatic indenting of program list-
|
||||
ing for greatly improved readability.
|
||||
! * Protects against use of GOTO into or
|
||||
! out of a Block Structure.
|
||||
* Each Block Structure can define an
|
||||
error handler.
|
||||
|
||||
%
|
||||
4,10,19,69,0,BetterBASIC Block Structure Statements,F
|
||||
|
||||
* FOR ... NEXT
|
||||
* DO n TIMES ... REPEAT {IF cond}
|
||||
* DO ... END DO
|
||||
* DO ... REPEAT {IF cond}
|
||||
* DO IF cond ... END DO
|
||||
* DO IF cond ... REPEAT {IF cond}
|
||||
* DO UNTIL cond ... REPEAT
|
||||
* WHILE cond DO ... REPEAT
|
||||
* EXIT
|
||||
* EXIT n LEVELS
|
||||
|
||||
%
|
||||
0,0,0,0,1,,N
|
||||
! Some examples:
|
||||
%
|
||||
=,0,7,0,12,7,15,0
|
||||
7,15,17,64,0,DO n TIMES,F
|
||||
|
||||
|
||||
10 DO 6 TIMES
|
||||
20 PRINT "REPEATS SIX TIMES"
|
||||
30 REPEAT
|
||||
%
|
||||
7,15,17,64,0,DO ... REPEAT IF,F
|
||||
|
||||
|
||||
10 DO
|
||||
20 INPUT "Type a number: " X
|
||||
30 REPEAT IF X<0
|
||||
%
|
||||
7,15,17,64,0,DO IF ... END DO,F
|
||||
|
||||
10 INPUT "Type a number: " X
|
||||
20 DO IF X<0
|
||||
30 PRINT "Illegal Value"
|
||||
40 X=0
|
||||
50 END DO
|
||||
%
|
||||
7,15,17,64,0,DO UNTIL,F
|
||||
|
||||
|
||||
10 DO UNTIL A$<>""
|
||||
20 A$=INKEY$
|
||||
30 REPEAT
|
||||
%
|
||||
7,15,17,64,0,WHILE ... DO,F
|
||||
|
||||
|
||||
10 WHILE X>0 AND Y<0 DO
|
||||
20 INPUT X,Y
|
||||
30 REPEAT
|
||||
%
|
||||
=,1,7,0,7,0,14,1
|
||||
6,5,21,64,0,PROCEDURES & FUNCTIONS,F
|
||||
|
||||
A BetterBASIC Procedure is a complete named sub-program
|
||||
which exists in its own private workspace. Each
|
||||
Procedure has its own private line numbers and local
|
||||
variables. Procedures are called by name, and
|
||||
arguments passed to the Procedure are validated for
|
||||
type and quantity. A Procedure may access external
|
||||
(shared) variables.
|
||||
|
||||
A BetterBASIC Function is much like a Procedure, except
|
||||
that it has a TYPE (integer, real or string) and
|
||||
returns a value of that type.
|
||||
%
|
||||
8,0,23,59,0,ARGUMENT PROCESSING,F
|
||||
|
||||
Procedures and Functions generally specify arguments
|
||||
(parameters) which must be passed at the time of the
|
||||
Procedure/Function call. In BetterBASIC arguments can
|
||||
be required or optional, with specified option values.
|
||||
|
||||
BetterBASIC also allows the creation of so-called
|
||||
Procedure Families, which share a single name, but
|
||||
which can have completely different argument
|
||||
requirements.
|
||||
|
||||
Procedures and Functions of the same name can coexist.
|
||||
%
|
||||
0,20,15,79,0,LOCAL VARIABLES,F
|
||||
|
||||
Each Procedure and Function has its own set of local
|
||||
(private) variables which cannot be accessed by any
|
||||
other Procedure or Function. This guarantees that an
|
||||
error in one Procedure cannot cause an unexpected
|
||||
side-effect error in another.
|
||||
|
||||
Procedures and Functions can also declare EXTERNAL
|
||||
variables, a feature which allow several Procedures and
|
||||
Functions to share variables.
|
||||
|
||||
%
|
||||
2,15,17,74,0,SEPARATELY COMPILED MODULES,F
|
||||
|
||||
Using BetterBASIC you can create software Modules
|
||||
containing useful Procedures and Functions. When
|
||||
completed and debugged, these Modules can be saved on
|
||||
disk for future use. Entering the name of such a
|
||||
Module in a BetterBASIC Configuration File, will cause
|
||||
the Module to be loaded into memory as part of
|
||||
BetterBASIC. All Procedures and Functions which were
|
||||
declared as PUBLIC within the Module become accessible
|
||||
to any BetterBASIC program.
|
||||
|
||||
%
|
||||
4,10,19,69,0,LANGUAGE EXTENDABILITY,F
|
||||
|
||||
Procedures and Functions created by the user and stored
|
||||
in a BetterBASIC Module can be used to extend the
|
||||
BetterBASIC language. If your application programs
|
||||
call for repeated use of a set of Functions or
|
||||
Procedures, you can create these Functions or
|
||||
Procedures in BetterBASIC and, using the Module
|
||||
concept, make these Procedures and Functions a
|
||||
permanent part of your BetterBASIC.
|
||||
|
||||
With this capability, OEM's can create their own
|
||||
support for special I/O devices such as graphics,
|
||||
mice, digitizers and so on.
|
||||
%
|
||||
6,5,21,64,0,ASSEMBLY LANGUAGE INTERFACE,F
|
||||
|
||||
BetterBASIC provides an exceptional clean and easy to
|
||||
use interface to procedures written in Assembly
|
||||
Language. Using the Assembly Language utilities
|
||||
availabale for your computer (ASM,MASM,LINK and
|
||||
EXE2BIN), the creation of Assembly Language procedures
|
||||
is a strightforward matter. Once created, such
|
||||
procedures become an integral part of your program or
|
||||
module.
|
||||
|
||||
Assembly Language procedures are called by name, and
|
||||
arguments passed to the procedures are validated for
|
||||
type and quantity.
|
||||
%
|
||||
8,0,23,59,0,BUILT-IN UTILITIES,F
|
||||
|
||||
|
||||
BetterBASIC includes the following built-in utility
|
||||
programs:
|
||||
|
||||
1. Screen editor
|
||||
|
||||
2. Module Linker
|
||||
|
||||
3. Cross Reference Lister.
|
||||
%
|
||||
0,0,23,79,0,The BetterBASIC Tutorial,F
|
||||
|
||||
To illustrate some of the new features of BetterBASIC, Summit Software
|
||||
Technology has designed the following simple tutorial. The tutorial
|
||||
consists of a number of lessons which will be displayed in a Lesson Window
|
||||
at the right hand side of the display screen. The left hand side of the
|
||||
display is a Work-Area Window where you are free to use BetterBASIC in the
|
||||
normal way. We suggest that you try each of the examples given before
|
||||
continuing with the next lesson.
|
||||
|
||||
The PC's function keys are used as follows:
|
||||
|
||||
F1 : Display the NEXT lesson
|
||||
|
||||
F2 : Display the PREVIOUS lesson
|
||||
|
||||
F10: Exit the tutor
|
||||
|
||||
!In the future you may use the [Esc] key to skip these introductory
|
||||
!explanations and go directly to the lessons.
|
||||
#
|
||||
|
396
Microsoft BASIC Compiler v5.36/SAMPLE.3
Normal file
396
Microsoft BASIC Compiler v5.36/SAMPLE.3
Normal file
@ -0,0 +1,396 @@
|
||||
.1
|
||||
This window will show examples of
|
||||
BetterBASIC features which are not
|
||||
available in any BASIC which you may
|
||||
be used to.
|
||||
|
||||
Please try each program example on
|
||||
the computer by entering the sample
|
||||
program as shown. Use LIST and EDIT
|
||||
to display and change your program,
|
||||
and NEW or SCRATCH to delete an
|
||||
existing program from memory.
|
||||
|
||||
|
||||
|
||||
! Strike F1 for the first lesson.
|
||||
|
||||
%
|
||||
.2
|
||||
First let us explore some of the
|
||||
BetterBASIC Block Structures and the
|
||||
properties of Block Structures.
|
||||
|
||||
Enter the following program:
|
||||
|
||||
! 10 FOR X=1 TO 16
|
||||
! 20 PRINT BIN$(X),HEX$(X)
|
||||
! 30 GOTO 10
|
||||
! 40 NEXT
|
||||
|
||||
Use the LIST command to list the
|
||||
program. Note the automatic
|
||||
indentation. Try the RUN command.
|
||||
You will see that BetterBASIC will
|
||||
not execute programs with GOTO's
|
||||
into or out of a Block Structure.
|
||||
|
||||
Use 'DELETE 30' to remove the
|
||||
offending line.
|
||||
|
||||
! Now try RUN
|
||||
%
|
||||
.3
|
||||
You will have noted that BetterBASIC
|
||||
lists the variables used and their
|
||||
type at the head of the program. As
|
||||
your program grows in size, you will
|
||||
find this a very useful overview of
|
||||
the variables you are using in a
|
||||
program.
|
||||
|
||||
This listing will contain the names
|
||||
and types of only those variables
|
||||
actually referenced in the program.
|
||||
Variables which have been declared
|
||||
but not referenced will not be
|
||||
listed.
|
||||
|
||||
To list the program without the data
|
||||
declarations use the command 'LIST-'
|
||||
|
||||
BetterBASIC has a built-in Cross
|
||||
Reference Lister. Try the command
|
||||
'XREF' which will list all lines in
|
||||
which each variable is used.
|
||||
%
|
||||
.4
|
||||
Let us modify our program by adding
|
||||
the following program lines:
|
||||
|
||||
! 5 DO 3 TIMES
|
||||
! 50 REPEAT
|
||||
|
||||
List the program, it should now look
|
||||
like this:
|
||||
|
||||
! 5 DO 3 TIMES
|
||||
! 10 FOR X=1 TO 16
|
||||
! 20 PRINT BIN$(X),HEX$(X)
|
||||
! 40 NEXT
|
||||
! 50 REPEAT
|
||||
|
||||
Note that nested Block Structures
|
||||
are indented multiple levels. This
|
||||
greatly enhances the readability of
|
||||
block structured programs.
|
||||
|
||||
! Use RUN to execute the program.
|
||||
|
||||
%
|
||||
.5
|
||||
Next let us create a BetterBASIC
|
||||
Procedure to beep the PC's speaker.
|
||||
Let us call this procedure 'Bell'.
|
||||
Create a WORKSPACE for this
|
||||
procedure by typing the Declaration:
|
||||
|
||||
! PROCEDURE: Bell
|
||||
|
||||
Observe what happens. The status-
|
||||
line at the bottom of the screen
|
||||
informs us that we are now inside
|
||||
procedure Bell's workspace.
|
||||
|
||||
Try the 'LIST' command. Nothing is
|
||||
listed!! What happened to our
|
||||
program? It is still there, but in
|
||||
its own workspace called MAIN. The
|
||||
display and keyboard is now attached
|
||||
to Bell's workspace which is empty.
|
||||
Commands like EDIT and LIST always
|
||||
operate in the current workspace.
|
||||
%
|
||||
.6
|
||||
Enter the following program line:
|
||||
|
||||
! 10 PRINT CHR$(7);
|
||||
|
||||
ASCII character 7 is the BELL
|
||||
character. When output to the
|
||||
screen this character beeps the PC's
|
||||
speaker.
|
||||
|
||||
Note that we used line number 10
|
||||
even though we already had a line 10
|
||||
in the MAIN program. Each Procedure
|
||||
(and Function) workspace has its own
|
||||
set of line numbers. Return to the
|
||||
MAIN program's workspace by issuing
|
||||
the command:
|
||||
|
||||
! MAIN
|
||||
|
||||
Use the LIST command to satisfy
|
||||
yourself that we are now in the MAIN
|
||||
program's workspace.
|
||||
%
|
||||
.7
|
||||
Add the following statement to the
|
||||
MAIN program:
|
||||
|
||||
! 8 Bell
|
||||
|
||||
Note that the BetterBASIC compiler
|
||||
accepts the word 'Bell' as though
|
||||
this was a normal BetterBASIC
|
||||
keyword. LIST your program, it
|
||||
should look like this:
|
||||
|
||||
! 5 DO 3 TIMES
|
||||
! 8 Bell
|
||||
! 10 FOR X=1 TO 16
|
||||
! 20 PRINT BIN$(X),HEX$(X)
|
||||
! 40 NEXT
|
||||
! 50 REPEAT
|
||||
|
||||
Note that we called Bell by just
|
||||
using its name (no CALL is used).
|
||||
|
||||
!Use RUN to execute the program.
|
||||
%
|
||||
.8
|
||||
Procedures are, of course, rarely as
|
||||
simple as the one-liner we just
|
||||
created. In general, Procedures
|
||||
consist of many program lines (as
|
||||
many as you need), and also in
|
||||
general require parameters or
|
||||
ARGUMENTS to be passed along as
|
||||
information to the procedure.
|
||||
|
||||
Let us design a Procedure to print
|
||||
an asterisk a given number of
|
||||
positions from the left hand side of
|
||||
the screen. First declare the
|
||||
procedure:
|
||||
|
||||
! PROCEDURE: Plot
|
||||
|
||||
Observe that the Status Line changes
|
||||
to indicate the new workspace.
|
||||
%
|
||||
.9
|
||||
We wish to pass a parameter to Plot
|
||||
which gives the position of the
|
||||
asterisk. We declare this parameter
|
||||
as follows:
|
||||
|
||||
! INT ARG: X
|
||||
|
||||
This declaration does two separate
|
||||
jobs. It informs the BetterBASIC
|
||||
compiler that an integer number is
|
||||
required as an argument when Plot is
|
||||
called, and it also gives the Plot
|
||||
Procedure a means of accessing the
|
||||
actual value passed as the value of
|
||||
'X'. Now enter Plot's program:
|
||||
|
||||
! 10 DO X TIMES
|
||||
! 20 PRINT " ";
|
||||
! 30 REPEAT
|
||||
! 40 PRINT "*"
|
||||
|
||||
!Use the command MAIN to exit Plot.
|
||||
%
|
||||
.10
|
||||
Now modify the MAIN program by
|
||||
entering the program line:
|
||||
|
||||
! 20 Plot X
|
||||
|
||||
Use LIST to verify that your program
|
||||
now is as follows:
|
||||
|
||||
! 5 DO 3 TIMES
|
||||
! 8 Bell
|
||||
! 10 FOR X=1 TO 16
|
||||
! 20 Plot X
|
||||
! 40 NEXT
|
||||
! 50 REPEAT
|
||||
|
||||
Use RUN to execute the program. Does
|
||||
the program do what you expected ?
|
||||
|
||||
!See how we use the Procedure Plot in
|
||||
!exactly the same way that we use
|
||||
!ordinary BetterBASIC keywords.
|
||||
%
|
||||
.11
|
||||
! BetterBASIC FUNCTIONS
|
||||
|
||||
BetterBASIC Functions are created in
|
||||
much the same way as Procedures.
|
||||
Procedures perform actions;
|
||||
Functions may perform actions, but
|
||||
always return as VALUE.
|
||||
|
||||
BetterBASIC supports three types of
|
||||
Function:
|
||||
|
||||
! INTEGER Function
|
||||
! REAL Function
|
||||
! STRING Function
|
||||
|
||||
Like Procedures, Functions can be
|
||||
very simple, or arbitrarily complex.
|
||||
Like Procedures, Functions can
|
||||
specify from none to many ARGUMENTS
|
||||
which must be passed when using the
|
||||
Function.
|
||||
%
|
||||
.12
|
||||
Let us create a simple Function
|
||||
named Double, which simply returns a
|
||||
value which is the argument
|
||||
multiplied by 2. Let us also assume
|
||||
that we wish to report an error if
|
||||
the argument is negative. First
|
||||
declare the Function:
|
||||
|
||||
! REAL FUNCTION: Double
|
||||
|
||||
This creates a workspace for the
|
||||
Function (Check the Status Line).
|
||||
The program for this function is:
|
||||
|
||||
! REAL ARG:X
|
||||
! 10 IF X<0 THEN ERROR 555
|
||||
! 20 RESULT=X*2
|
||||
|
||||
Note that the LAST statement is the
|
||||
RESULT statement. This is a
|
||||
requirement in Functions.
|
||||
!Use MAIN to exit from Double.
|
||||
%
|
||||
.13
|
||||
First try some immediate mode
|
||||
statements:
|
||||
|
||||
! PRINT Double(12.33)
|
||||
! PRINT Double(.023)
|
||||
! PRINT Double(1+Double(23.7))
|
||||
|
||||
As you can see, function calls can
|
||||
be nested. Try the following:
|
||||
|
||||
! PRINT Double(1-1.23)
|
||||
|
||||
Note the way BetterBASIC notifies
|
||||
you of errors. Not only do you get
|
||||
an error code and a line number,
|
||||
BetterBASIC also informs you of the
|
||||
origin of the error.
|
||||
|
||||
This is important. Without this
|
||||
information it would be difficult to
|
||||
locate the source of the error.
|
||||
%
|
||||
.14
|
||||
Next modify the MAIN program as
|
||||
follows:
|
||||
|
||||
! 20 Plot Double(X)
|
||||
|
||||
Again, the BetterBASIC compiler
|
||||
accepts 'Double' as though it was a
|
||||
standard BetterBASIC function.
|
||||
|
||||
The program should now LIST like
|
||||
this:
|
||||
|
||||
! 5 DO 3 TIMES
|
||||
! 8 Bell
|
||||
! 10 FOR X=1 TO 16
|
||||
! 20 Plot Double(X)
|
||||
! 40 NEXT
|
||||
! 50 REPEAT
|
||||
|
||||
! RUN the program.
|
||||
%
|
||||
.15
|
||||
! Program Listing.
|
||||
|
||||
So far, we have listed each
|
||||
individual program workspace using
|
||||
the LIST command. To list all
|
||||
workspaces we use the following
|
||||
command:
|
||||
|
||||
! LIST ALL
|
||||
|
||||
Try it. See how all the procedures
|
||||
and functions are listed. To list
|
||||
just the names of the workspaces you
|
||||
can use:
|
||||
|
||||
! LIST PROCS
|
||||
|
||||
Here, the word 'PROCS' refers to
|
||||
both Procedures and Functions
|
||||
%
|
||||
.16
|
||||
Next we will show you how to create
|
||||
a BetterBASIC MODULE. To create
|
||||
such a Module, a BetterBASIC program
|
||||
which has been created interactively
|
||||
must first be saved and re-compiled
|
||||
to allow the compiler to pass
|
||||
necessary information to the Module
|
||||
Linker.
|
||||
|
||||
! Saving Programs
|
||||
|
||||
This sample version of BetterBASIC
|
||||
does not allow programs to be SAVEd
|
||||
to disk.
|
||||
|
||||
%
|
||||
.17
|
||||
You can, however use the 'LIST ALL'
|
||||
command to save a listing of your
|
||||
program, which can be recompiled
|
||||
using the 'LOAD' command.
|
||||
|
||||
Issue the following command:
|
||||
|
||||
! LIST ALL "foo"
|
||||
|
||||
Now clear memory by typing the
|
||||
following command: (The screen will
|
||||
blank, and after a few seconds you
|
||||
will be back to this lesson!!).
|
||||
|
||||
! SCRATCH
|
||||
|
||||
%
|
||||
.18
|
||||
We hope that these lessons have
|
||||
given you an idea of the power and
|
||||
flexibility of BetterBASIC. At this
|
||||
time you should probably print out
|
||||
the manual which came on your sample
|
||||
disk. It's the file called READ.ME.
|
||||
This manual will explain further
|
||||
about how to combine procedures and
|
||||
functions like the ones you just
|
||||
created into Modules. Also you can
|
||||
read about the different data types
|
||||
such as Record Variables which can
|
||||
be used for random file I/O.
|
||||
|
||||
! HAPPY PROGRAMMING......
|
||||
%
|
||||
#
|
||||
|
186
Microsoft BASIC Compiler v5.36/SAMPLE.4
Normal file
186
Microsoft BASIC Compiler v5.36/SAMPLE.4
Normal file
@ -0,0 +1,186 @@
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,11,1,15,12,0,14,0
|
||||
8,10,16,69,0,BetterBASIC versus PC-BASIC (BASICA),F
|
||||
|
||||
Since the BASIC you are now using is almost certainly
|
||||
Microsoft's BASICA or a derivative such as GW-BASIC, we
|
||||
feel that a comparison betwen BetterBASIC and
|
||||
Microsoft's BASIC is in order.
|
||||
%
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,11,1,15,12,0,14,0
|
||||
0,0,7,25,500,Memory Support,F
|
||||
|
||||
!BetterBASIC: 640K
|
||||
|
||||
Microsoft: 64K
|
||||
%
|
||||
0,54,7,79,500,Execution Speed,F
|
||||
Sieve of
|
||||
Erastosthenes:
|
||||
|
||||
!BetterBASIC: 31.9 secs
|
||||
|
||||
Microsoft: 191.1 secs
|
||||
%
|
||||
16,54,23,79,500,8087 Support ?,F
|
||||
|
||||
!BetterBASIC: Option
|
||||
|
||||
Microsoft: NO
|
||||
%
|
||||
16,0,23,25,500,Syntax Check,F
|
||||
|
||||
!BetterBASIC: On Entry
|
||||
|
||||
Microsoft: At Runtime
|
||||
%
|
||||
0,26,7,53,500,WINDOWS Support,F
|
||||
|
||||
!BetterBASIC: YES
|
||||
|
||||
Microsoft: NO
|
||||
%
|
||||
8,54,15,79,500,DOS/BIOS Calls ?,F
|
||||
|
||||
!BetterBASIC: YES
|
||||
|
||||
Microsoft: NO
|
||||
%
|
||||
16,26,23,53,500,Cross References ?,F
|
||||
|
||||
!BetterBASIC: YES
|
||||
|
||||
Microsoft: NO
|
||||
%
|
||||
8,0,15,25,500,Nested Overlays ?,F
|
||||
|
||||
!BetterBASIC: YES
|
||||
|
||||
Microsoft: NO
|
||||
%
|
||||
8,26,15,53,0,,
|
||||
|
||||
! BetterBASIC
|
||||
|
||||
really is
|
||||
|
||||
! BETTER
|
||||
! ======
|
||||
%
|
||||
=,12,0,10,12,0,15,0
|
||||
5,15,18,64,0,Microsoft BASIC Data-Types:,F
|
||||
|
||||
|
||||
* INTEGER
|
||||
* REAL - IEEE format
|
||||
* STRINGS to 255 characters
|
||||
* N-dimensional Arrays of
|
||||
above types.
|
||||
%
|
||||
5,15,18,64,0,BetterBASIC Data-Types:,F
|
||||
! * BYTE, INTEGER
|
||||
! * REAL
|
||||
! - Variable Precision Decimal
|
||||
! - High Speed Binary
|
||||
! - IEEE format with 8087
|
||||
! * STRINGS to 32767 characters
|
||||
! * STRUCTURE / RECORD
|
||||
! * POINTER
|
||||
! * N-Dimensional ARRAYS of all types
|
||||
! * Arrays of ARRAYS.
|
||||
! * Static or Dynamic Variables
|
||||
%
|
||||
5,15,18,64,0,Support for Structured Programming ?,F
|
||||
|
||||
|
||||
!BetterBASIC: * Block Structures
|
||||
! * Indented Listings
|
||||
! * Procedures
|
||||
! * Functions
|
||||
! * Local Variables
|
||||
|
||||
Microsoft: None of the above
|
||||
%
|
||||
5,15,18,64,0,Support for Modular Programming ?,F
|
||||
|
||||
|
||||
!BetterBASIC: * Procedures
|
||||
! * Functions
|
||||
! * Separately compiled
|
||||
! Program Modules
|
||||
|
||||
Microsoft: None of the above
|
||||
%
|
||||
5,15,18,64,0,Support for Overlays ?,F
|
||||
|
||||
! BetterBASIC:
|
||||
|
||||
!Supports nested overlays with COMMON
|
||||
!variables and AUTOMATIC save/restore to disk
|
||||
!of all non-common variables. Allows recursive
|
||||
!overlays.
|
||||
|
||||
GW-BASIC:
|
||||
|
||||
Simple CHAIN only
|
||||
%
|
||||
5,15,18,64,0,Support for DOS/BIOS calls ?,F
|
||||
|
||||
! BetterBASIC:
|
||||
|
||||
!Allows calls to DOS or the machine BIOS
|
||||
!(Basic Input Output System) directly from
|
||||
!BetterBASIC. Provides direct access to all
|
||||
!CPU registers by name.
|
||||
|
||||
GW-BASIC:
|
||||
|
||||
Not supported.
|
||||
%
|
||||
5,15,18,64,0,Create your own BASIC statements ?,F
|
||||
|
||||
! BetterBASIC:
|
||||
|
||||
!Create your own Modules containing Procedures
|
||||
!and Functions designed to extend BetterBASIC
|
||||
!into new applications such as Graphics,
|
||||
!Process Control, and so on.
|
||||
|
||||
Microsoft BASIC:
|
||||
|
||||
Can't be done.
|
||||
%
|
||||
5,15,18,64,0,If you are an OEM:,F
|
||||
|
||||
!With BetterBASIC you can create your own
|
||||
!support for hardware features which make your
|
||||
!computer different from all the others.
|
||||
|
||||
!- or, you can tailor-fit BetterBASIC to a
|
||||
!particular market that you are targeting,
|
||||
!such as business, laboratory, automation, and
|
||||
!so on .....
|
||||
|
||||
With Microsoft BASIC you're stuck !!
|
||||
%
|
||||
=,0,0,0,14,0,0,0
|
||||
5,15,18,64,1,,F
|
||||
%
|
||||
=,0,0,0,10,0,0,0
|
||||
6,17,17,62,1,,F
|
||||
%
|
||||
=,0,0,0,9,0,0,0
|
||||
7,19,16,60,1,,F
|
||||
%
|
||||
=,0,0,0,1,0,0,0
|
||||
8,21,15,58,1,,F
|
||||
%
|
||||
=,15,0,0,12,0,0,0
|
||||
9,23,14,56,2000,,F
|
||||
|
||||
BetterBASIC really is BETTER !!!
|
||||
#
|
||||
|
139
Microsoft BASIC Compiler v5.36/SAMPLE.5
Normal file
139
Microsoft BASIC Compiler v5.36/SAMPLE.5
Normal file
@ -0,0 +1,139 @@
|
||||
=,1,7,4,11,1,14,1
|
||||
0,0,17,79,0,Compatibility Issues,F
|
||||
|
||||
As you will see from the BetterBASIC tutorial, we have designed
|
||||
BetterBASIC to provide a whole new range of structured and modular
|
||||
programming concepts ON TOP OF a Microsoft-like root level.
|
||||
|
||||
The question is now: How compatible is BetterBASIC, and what are the major
|
||||
differences ?
|
||||
|
||||
Some of the incompatibilities arise from the structure of BetterBASIC
|
||||
itself, other are caused by BetterBASIC offering very much "cleaner"
|
||||
solutions to some of Microsoft BASIC's "kludgy" mechanisms.
|
||||
|
||||
|
||||
! Here are the major differemces:
|
||||
|
||||
%
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,7,1,14,7,1,14,0
|
||||
0,0,15,60,0,String Size Declarations,F
|
||||
|
||||
In Microsoft BASIC, if a string is assigned a value
|
||||
longer than its current size, the old storage space is
|
||||
discarded and a new space allocated for that string.
|
||||
|
||||
In BetterBASIC strings are of fixed size and cannot be
|
||||
assigned values beyond the declared size. You must think
|
||||
ahead and plan the size of text string varaibles.
|
||||
|
||||
%
|
||||
2,4,17,64,0,The DEF FN Statement,F
|
||||
|
||||
BetterBASIC supports TRUE named Functions, with any
|
||||
number of arguments and Local Variables. BetterBASIC
|
||||
Functions can contain any number of lines of code.
|
||||
|
||||
- and -
|
||||
|
||||
! BetterBASIC functions can be RECURSIVE
|
||||
|
||||
This capability is far superior to the one-liner DEF FN
|
||||
statement in Microsoft BASIC.
|
||||
%
|
||||
4,8,19,68,0,GET - PUT - MKI$ - CVI -FIELD etc.,F
|
||||
|
||||
These statements are not supported in BetterBASIC.
|
||||
|
||||
Instead, BetterBASIC provides very much easier to use
|
||||
data types and statements to achieve the same result.
|
||||
BetterBASIC allows you to define structured RECORD
|
||||
Variables, with properly named FIELDS.
|
||||
|
||||
RECORD Variables (and other data types, for that matter)
|
||||
can be read from and written to disk using BetterBASIC's
|
||||
'READ RECORD' and 'WRITE RECORD' statements.
|
||||
|
||||
%
|
||||
6,12,21,72,0,Other Differences,F
|
||||
|
||||
! DATA
|
||||
BetterBASIC requires quotes around strings.
|
||||
|
||||
! DEFtype
|
||||
|
||||
Use BetterBASIC's INTEGER, REAL, STRING declarations.
|
||||
|
||||
! BLOAD, BSAVE, DEF USR
|
||||
|
||||
Use BetterBASIC's CODE command which provides a much
|
||||
simpler way to load and call Assembly Language
|
||||
procedures.
|
||||
%
|
||||
8,16,23,76,0,Other Differences,F
|
||||
|
||||
! DRAW
|
||||
The A, T and X commands are not supported.
|
||||
|
||||
! FOR ... NEXT
|
||||
BetterBASIC does not require a variable after the
|
||||
NEXT.
|
||||
! INPUT
|
||||
To suppress the question mark which is normally issued
|
||||
you must enter a null string prompt "". On error, the
|
||||
input statement will not not be retried unless a "?" is
|
||||
placed immediately after the INPUT keyword.
|
||||
%
|
||||
=,7,1,14,7,1,14,0
|
||||
0,0,15,60,0,Other Differences,F
|
||||
|
||||
! MERGE
|
||||
Use BetterBASIC's LOAD command.
|
||||
|
||||
! ON COM - ON KEY - ON PLAY
|
||||
|
||||
These statements vector to designated INTERRUPT
|
||||
PROCEDURES instead of Line Numbers.
|
||||
|
||||
%
|
||||
2,4,17,64,0,Other Differences,F
|
||||
|
||||
! SAVE
|
||||
This command saves the program in binary format. Use LIST
|
||||
ALL to save a BetterBASIC program in ASCII format.
|
||||
|
||||
! WINDOW
|
||||
The BetterBASIC WINDOW function returns the number of the
|
||||
currently active window. There is no statement which
|
||||
performs the same function as Microsoft BASIC's WINDOW
|
||||
statement.
|
||||
|
||||
! SCREEN
|
||||
BetterBASIC supports only a single diplay page
|
||||
%
|
||||
4,8,19,68,0,NOT SUPPORTED,F
|
||||
|
||||
! The following statements are not supported:
|
||||
|
||||
|
||||
CDBL CONT CSGN
|
||||
MOTOR PEN STICK
|
||||
TRON TROFF VIEW
|
||||
|
||||
%
|
||||
=,11,0,0,14,1,0,0
|
||||
6,10,18,66,0,,F
|
||||
|
||||
|
||||
====================================================
|
||||
|
||||
We suggest that you use this BetterBASIC sample to
|
||||
explore any differences which may affect any
|
||||
programs that you wish to convert to BetterBASIC.
|
||||
|
||||
====================================================
|
||||
#
|
||||
|
||||
|
55
Microsoft BASIC Compiler v5.36/SAMPLE.6
Normal file
55
Microsoft BASIC Compiler v5.36/SAMPLE.6
Normal file
@ -0,0 +1,55 @@
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,7,1,15,15,4,12,0
|
||||
8,10,20,69,0,The on-disk Manual,F
|
||||
|
||||
The manual which is on the disk consist of excerpts from
|
||||
the actual 714 page manual which is shipped with each
|
||||
BetterBASIC package. The file called READ.ME is the
|
||||
manual file. This "demo" manual is approximately 100
|
||||
pages long and details all of the major features of
|
||||
BetterBASIC so that you can use the sample disk to
|
||||
evaluate BetterBASIC.
|
||||
|
||||
%
|
||||
0,0,0,0,0,,N
|
||||
|
||||
There are two ways to print the manual out on your
|
||||
printer. The easiest way and the only way to do it on
|
||||
DOS 1.1 is to use the DOS command TYPE. To use this
|
||||
command to print the manual proceed as follows:
|
||||
|
||||
! 1. Press the Ctrl and the PrtSc keys
|
||||
! 2. Next issue the command TYPE READ.ME
|
||||
! 3. Then press the Enter key.
|
||||
|
||||
%
|
||||
0,0,0,0,0,,N
|
||||
If your printer is on line then the manual should start
|
||||
printing on the printer and be visible on the video
|
||||
display. After the manual is finished printing you
|
||||
should press the Ctrl and PrtSc keys to turn off the
|
||||
printer.
|
||||
|
||||
%
|
||||
0,0,0,0,0,,N
|
||||
An alternate way to print the manual in DOS 2.0, DOS
|
||||
2.1 or DOS 3.0 is to use the PRINT command as follows:
|
||||
|
||||
! 1. Type the command PRINT READ.ME
|
||||
! 2. Press the Enter key
|
||||
|
||||
If your printer is on line then the manual will be
|
||||
printed on it.
|
||||
|
||||
%
|
||||
0,0,0,0,0,,N
|
||||
|
||||
The commands which are not listed in this manual are
|
||||
similar to the commands in the PC BASIC manual and are
|
||||
not listed to save space on the disk. All BetterBASIC
|
||||
commands are, of course, fully documented in the
|
||||
714-page manual shipped with BetterBASIC.
|
||||
|
||||
#
|
||||
|
59
Microsoft BASIC Compiler v5.36/SAMPLE.7
Normal file
59
Microsoft BASIC Compiler v5.36/SAMPLE.7
Normal file
@ -0,0 +1,59 @@
|
||||
=,11,1,14,12,0,12,8
|
||||
0,0,23,79,0,BetterBASIC Products & Prices,F
|
||||
|
||||
|
||||
! BetterBASIC Programming System: $199.-
|
||||
Includes support for Graphics
|
||||
and WINDOWS.
|
||||
|
||||
! 8087 Math Module: $ 99.-
|
||||
Provides "invisible" support for
|
||||
the high speed 8087 co-processor.
|
||||
|
||||
! Runtime System: $250.-
|
||||
Generates .EXE files which can
|
||||
be sold without any further royalty
|
||||
or sub-license restrictions.
|
||||
|
||||
%
|
||||
0,0,0,0,0,,N
|
||||
|
||||
|
||||
|
||||
! High Speed Binary Math Module: $ 49.-
|
||||
Provides much higher speed than BCD
|
||||
Math Package at reduced accuracy.
|
||||
Has both single(6 1/2 digit) and
|
||||
double (14 digit) precision routines.
|
||||
|
||||
! Btrieve Interface Module $ 99.-
|
||||
Provides a high-level interface to
|
||||
SoftCraft Inc. Btrieve Data Base
|
||||
File Manager.
|
||||
|
||||
! Shipping & Handling: $ 5.-
|
||||
! Overnight delivery: $ 20.-
|
||||
Mass. residents add 5% Sales Tax.
|
||||
%
|
||||
0,0,23,79,0,HOW TO ORDER BETTER BASIC,F
|
||||
|
||||
|
||||
! Order BetterBASIC from your FAVORITE DEALER
|
||||
|
||||
-or use the enclosed Order Card to order directly from:
|
||||
|
||||
! Summit Software Technology, Inc
|
||||
! P.O. Box 99
|
||||
! Babson Park
|
||||
! Wellesley, MA 02157
|
||||
|
||||
! OR CALL TOLL FREE: 1-800-225-5800
|
||||
|
||||
We accept payment as follows:
|
||||
|
||||
! VISA or MASTER CHARGE
|
||||
Money Orders
|
||||
Personal Checks.
|
||||
! Company Purchase Orders
|
||||
#
|
||||
|
23
Microsoft BASIC Compiler v5.36/SAMPLE.8
Normal file
23
Microsoft BASIC Compiler v5.36/SAMPLE.8
Normal file
@ -0,0 +1,23 @@
|
||||
=,11,1,14,14,0,15,1
|
||||
0,10,22,69,0,Using BetterBASIC,F
|
||||
|
||||
Before using BetterBASIC, we recommend that you print
|
||||
the Abbreviated Manual(READ.ME) which is on this disk.
|
||||
|
||||
!This sample of BetterBASIC has been restricted in the
|
||||
!folowing ways:
|
||||
|
||||
1. You can only use line-numbers up to 50
|
||||
|
||||
2. You can only create up to 6 Procedures/Functions.
|
||||
|
||||
3. You cannot save your program in binary format, but
|
||||
you can list it in ASCII format (LIST ALL).
|
||||
|
||||
4. Renumber is not available.
|
||||
|
||||
!In all other respects this is a standard BetterBASIC
|
||||
|
||||
! Use F10 to return to the Sample Menu
|
||||
#
|
||||
|
93
Microsoft BASIC Compiler v5.36/SAMPLE.9
Normal file
93
Microsoft BASIC Compiler v5.36/SAMPLE.9
Normal file
@ -0,0 +1,93 @@
|
||||
==
|
||||
0,0,23,79,0,,C
|
||||
=,7,0,14,0,0,0,0
|
||||
10,10,20,69,500,,
|
||||
! ==================================================
|
||||
! Here are some of the benefits of using BetterBASIC
|
||||
! ==================================================
|
||||
%
|
||||
0,0,23,79,0,,C
|
||||
=,7,1,15,12,0,11,0
|
||||
2,5,21,74,0,WHY BetterBASIC ?,F
|
||||
|
||||
! PRODUCTIVITY
|
||||
|
||||
The ultimate purpose of any programming language is productivity.
|
||||
Languages like PASCAL and MODULA 2 are considered to be
|
||||
productive, old-fashioned BASIC is not.
|
||||
|
||||
BetterBASIC incorporates all those features of PASCAL and MODULA 2
|
||||
which make those languages productive. The most important are:
|
||||
|
||||
! Structure and Modularity.
|
||||
|
||||
The structure and modularity of BetterBASIC allows you to break
|
||||
any programming problem into small, easy to manage pieces, rather
|
||||
than the huge tangle of "spaghetti-code" you have to face with
|
||||
ordinary BASIC.
|
||||
%
|
||||
0,0,0,0,0,,N
|
||||
|
||||
! RELIABILITY
|
||||
|
||||
Reliability is obviously just as important as productivity. How
|
||||
does BetterBASIC help you create reliable code?
|
||||
|
||||
The biggest problem with ordinary BASIC lies in its global
|
||||
structure. Everything is accessible from everywhere else. The
|
||||
most frequent bugs encountered by BASIC programmers are due to
|
||||
so-called side effects, whereby a datum is inadvertently altered
|
||||
or destroyed by a subroutine which was not supposed to have access
|
||||
to that datum.
|
||||
|
||||
BetterBASIC provides Procedures and Functions with local
|
||||
variables, which prevent a Procedure or Function from accessing
|
||||
any datum inadvertantly.
|
||||
%
|
||||
0,0,0,0,0,,N
|
||||
|
||||
! MANAGABILITY
|
||||
|
||||
Ask any software manager about managing a software project written
|
||||
in any conventional BASIC which involves a team of several
|
||||
programmers. It's a horror show!!
|
||||
|
||||
BetterBASIC supports not only Procedures and Functions, but also
|
||||
separately created Modules. Procedures, Functions and Modules
|
||||
allow proper specification of software sub-system functions, in
|
||||
such a way that a large project can be cleanly divided up among
|
||||
several programmers.
|
||||
|
||||
Once tested and debugged, a BetterBASIC Module will work as
|
||||
intended no matter what the application is. There will be no
|
||||
unexpected side-effects.
|
||||
%
|
||||
0,0,0,0,100,,N
|
||||
|
||||
! REUSABILITY
|
||||
|
||||
Ordinary BASIC code is in general not reusable. Identical
|
||||
algorithms land up being coded over and over for each new
|
||||
application.
|
||||
|
||||
BetterBASIC code is reusable. The ability to reuse program code
|
||||
from application to application results in:
|
||||
|
||||
%
|
||||
=,7,1,15,11,0,14,0
|
||||
14,12,20,66,0,Increased Productivity,F
|
||||
|
||||
! No need to recreate work already done.
|
||||
%
|
||||
=,7,1,15,11,0,14,0
|
||||
14,12,20,66,0,Increased Reliability,F
|
||||
|
||||
! No new bugs will be created.
|
||||
%
|
||||
=,7,1,15,11,0,14,0
|
||||
14,12,20,66,0,Reduced Maintenance Costs,F
|
||||
|
||||
! Only one piece of code to maintain for
|
||||
! many different applications.
|
||||
#
|
||||
|
BIN
Microsoft BASIC Compiler v5.36/SAMPLE.COM
Normal file
BIN
Microsoft BASIC Compiler v5.36/SAMPLE.COM
Normal file
Binary file not shown.
BIN
Microsoft BASIC Compiler v5.36/SAMPLE.MOD
Normal file
BIN
Microsoft BASIC Compiler v5.36/SAMPLE.MOD
Normal file
Binary file not shown.
31
Microsoft BASIC Compiler v5.36/e.bas
Normal file
31
Microsoft BASIC Compiler v5.36/e.bas
Normal file
@ -0,0 +1,31 @@
|
||||
100 DIGITS% = 200
|
||||
110 DIM A%( 200 )
|
||||
120 HIGH% = DIGITS%
|
||||
130 X% = 0
|
||||
140 N% = HIGH% - 1
|
||||
150 IF N% <= 0 GOTO 200
|
||||
160 A%[ N% ] = 1
|
||||
170 N% = N% - 1
|
||||
180 GOTO 150
|
||||
200 A%[ 1 ] = 2
|
||||
210 A%[ 0 ] = 0
|
||||
220 IF HIGH% <= 9 GOTO 400
|
||||
230 HIGH% = HIGH% - 1
|
||||
235 N% = HIGH%
|
||||
240 IF N% = 0 GOTO 300
|
||||
250 A%[ N% ] = X% MOD N%
|
||||
255 rem PRINT "a[n-1]"; A%[ N% - 1 ]
|
||||
260 X% = ( 10 * A%[ N% - 1 ] ) + ( X% \ N% )
|
||||
265 rem PRINT "x: "; X%, "n: "; N%
|
||||
270 N% = N% - 1
|
||||
280 GOTO 240
|
||||
300 IF X% >= 10 GOTO 330
|
||||
310 PRINT USING "#"; X%;
|
||||
320 GOTO 220
|
||||
330 PRINT USING "##"; X%;
|
||||
340 GOTO 220
|
||||
400 PRINT ""
|
||||
410 PRINT "done"
|
||||
420 SYSTEM
|
||||
|
||||
|
3
Microsoft BASIC Compiler v5.36/m.bat
Normal file
3
Microsoft BASIC Compiler v5.36/m.bat
Normal file
@ -0,0 +1,3 @@
|
||||
ntvdm -c bascom %1.bas,,%1.lst,
|
||||
ntvdm -c link %1,,%1,.\,nul
|
||||
|
67
Microsoft BASIC Compiler v5.36/mm.bas
Normal file
67
Microsoft BASIC Compiler v5.36/mm.bas
Normal file
@ -0,0 +1,67 @@
|
||||
REM A PROGRAM ID DO MATRICES
|
||||
19 DEFINT I- N
|
||||
25 M = 20 : N = 20
|
||||
50 SUM = 0
|
||||
55 REM INPUT "ENTER ANY CHARACTER TO START" ;JIVE$
|
||||
60 GOSUB 150
|
||||
65 REM PRINT "DIMENSIONED"
|
||||
70 GOSUB 200
|
||||
75 REM PRINT "A FILLED"
|
||||
80 GOSUB 280
|
||||
85 REM PRINT "B FILLED"
|
||||
90 GOSUB 360
|
||||
95 REM PRINT "C FILLED"
|
||||
100 GOSUB 440
|
||||
105 REM PRINT 1 "MULTIPLIED"
|
||||
110 GOSUB 540
|
||||
120 PRINT "SUM = ";SUM
|
||||
130 PRINT CHR$(7)
|
||||
140 GOTO 9999
|
||||
150 REM DIMENSION
|
||||
160 DIM A(20,20)
|
||||
170 DIM B(20,20)
|
||||
180 DIM C(20,20)
|
||||
190 RETURN
|
||||
200 REM FILL A
|
||||
210 FOR I = 1 TO 20
|
||||
220 FOR J = 1 TO 20
|
||||
230 A(I,J) = I + J
|
||||
240 NEXT
|
||||
250 NEXT
|
||||
260 RETURN
|
||||
270 REM *************
|
||||
280 REM FILL B
|
||||
290 FOR I = 1 TO 20
|
||||
300 FOR J = 1 TO 20
|
||||
310 B(I,J) = INT((I+J)/J)
|
||||
320 NEXT
|
||||
330 NEXT
|
||||
340 RETURN
|
||||
350 REM **********
|
||||
360 REM FILL C
|
||||
370 FOR I = 1 TO 20
|
||||
380 FOR J = 1 TO 20
|
||||
390 C(I,J) = 0
|
||||
400 NEXT
|
||||
410 NEXT
|
||||
420 RETURN
|
||||
430 REM **************
|
||||
440 REM ************ MULTIPLY
|
||||
450 FOR I = 1 TO 20
|
||||
460 FOR J = 1 TO 20
|
||||
470 FOR K = 1 TO 20
|
||||
480 C(I,J) = C(I,J) + A(I,K)*B(K,J)
|
||||
490 NEXT
|
||||
500 NEXT
|
||||
510 NEXT
|
||||
520 RETURN
|
||||
530 REM **************
|
||||
540 REM *************** SUMMIT
|
||||
550 FOR I = 1 TO 20
|
||||
560 FOR J = 1 TO 20
|
||||
570 SUM = SUM + C(I,J)
|
||||
580 NEXT
|
||||
590 NEXT
|
||||
600 RETURN
|
||||
610 REM ************************(
|
||||
9999 end
|
20
Microsoft BASIC Compiler v5.36/sieve.bas
Normal file
20
Microsoft BASIC Compiler v5.36/sieve.bas
Normal file
@ -0,0 +1,20 @@
|
||||
1 SIZE% = 8190
|
||||
2 DIM FLAGS%(8191)
|
||||
3 PRINT "10 iterations"
|
||||
4 FOR X% = 1 TO 10
|
||||
5 COUNT% = 0
|
||||
6 FOR I% = 0 TO SIZE%
|
||||
7 FLAGS%(I%) = 1
|
||||
8 NEXT I%
|
||||
9 FOR I% = 0 TO SIZE%
|
||||
10 IF FLAGS%(I%) = 0 THEN 18
|
||||
11 PRIME% = I% + I% + 3
|
||||
12 K% = I% + PRIME%
|
||||
13 IF K% > SIZE% THEN 17
|
||||
14 FLAGS%(K%) = 0
|
||||
15 K% = K% + PRIME%
|
||||
16 GOTO 13
|
||||
17 COUNT% = COUNT% + 1
|
||||
18 NEXT I%
|
||||
19 NEXT X%
|
||||
20 PRINT COUNT%," PRIMES"
|
118
Microsoft BASIC Compiler v5.36/ttt.bas
Normal file
118
Microsoft BASIC Compiler v5.36/ttt.bas
Normal file
@ -0,0 +1,118 @@
|
||||
1 REM Tic Tac Toe solving app that learns what WOPR learned: you can't win
|
||||
2 REM Only three starting positions are examined. Others are just reflections of these
|
||||
3 REM b% -- The board
|
||||
4 REM al% -- Alpha, for pruning
|
||||
5 REM be% -- Beta, for pruning
|
||||
6 REM l% -- Top-level loop iteration
|
||||
7 REM wi% -- The winning piece (0 none, 1 X, 2, O )
|
||||
8 REM re% -- Resulting score of 4000/minmax board position. 5 draw, 6 X win, 4 Y win
|
||||
9 REM sx% -- Stack array for "recursion" X can be P, V, A, or B for those variables.
|
||||
10 REM v% -- Value of a board position
|
||||
11 REM st% -- Stack Pointer. Even for alpha/beta pruning Minimize plys, Odd for Maximize
|
||||
12 REM p% -- Current position where a new piece is played
|
||||
14 REM rw% -- Row in the Winner function (2000)
|
||||
15 REM cw% -- Column in the Winner function (2000)
|
||||
18 REM mc% -- Move count total for debugging. Should be a multiple of 6493
|
||||
19 REM Note: Can't use real recursion with GOSUB because stack is limited to roughly 5 deep
|
||||
20 REM BASIC doesn't support goto/gosub using arrays for target line numbers
|
||||
30 DIM b%(9)
|
||||
32 DIM sp%(10)
|
||||
34 DIM sv%(10)
|
||||
36 DIM sa%(10)
|
||||
37 DIM sb%(10)
|
||||
38 mc% = 0
|
||||
39 PRINT "start time: "; TIME$
|
||||
40 FOR l% = 1 TO 100
|
||||
41 mc% = 0
|
||||
42 al% = 2
|
||||
43 be% = 9
|
||||
44 b%(0) = 1
|
||||
45 GOSUB 4000
|
||||
58 al% = 2
|
||||
59 be% = 9
|
||||
60 b%(0) = 0
|
||||
61 b%(1) = 1
|
||||
62 GOSUB 4000
|
||||
68 al% = 2
|
||||
69 be% = 9
|
||||
70 b%(1) = 0
|
||||
71 b%(4) = 1
|
||||
72 GOSUB 4000
|
||||
73 b%(4) = 0
|
||||
74 REM print "mc: "; mc%; " l is "; l%
|
||||
80 NEXT l%
|
||||
85 print "for "; l% - 1; " iterations"
|
||||
86 PRINT "end time: "; TIME$
|
||||
87 PRINT "final move count "; mc%
|
||||
88 SYSTEM
|
||||
100 END
|
||||
|
||||
2000 wi% = b%(0)
|
||||
2010 IF 0 = wi% GOTO 2100
|
||||
2020 IF wi% = b%(1) AND wi% = b%(2) THEN RETURN
|
||||
2030 IF wi% = b%(3) AND wi% = b%(6) THEN RETURN
|
||||
2100 wi% = b%(3)
|
||||
2110 IF 0 = wi% GOTO 2200
|
||||
2120 IF wi% = b%(4) AND wi% = b%(5) THEN RETURN
|
||||
2200 wi% = b%(6)
|
||||
2210 IF 0 = wi% GOTO 2300
|
||||
2220 IF wi% = b%(7) AND wi% = b%(8) THEN RETURN
|
||||
2300 wi% = b%(1)
|
||||
2310 IF 0 = wi% GOTO 2400
|
||||
2320 IF wi% = b%(4) AND wi% = b%(7) THEN RETURN
|
||||
2400 wi% = b%(2)
|
||||
2410 IF 0 = wi% GOTO 2500
|
||||
2420 IF wi% = b%(5) AND wi% = b%(8) THEN RETURN
|
||||
2500 wi% = b%(4)
|
||||
2510 IF 0 = wi% THEN RETURN
|
||||
2520 IF wi% = b%(0) AND wi% = b%(8) THEN RETURN
|
||||
2530 IF wi% = b%(2) AND wi% = b%(6) THEN RETURN
|
||||
2540 wi% = 0
|
||||
2550 RETURN
|
||||
|
||||
4000 REM minmax function to find score of a board position
|
||||
4010 REM recursion is simulated with gotos
|
||||
4030 st% = 0
|
||||
4040 v% = 0
|
||||
4060 re% = 0
|
||||
4100 mc% = mc% + 1
|
||||
4102 REM gosub 3000
|
||||
4104 IF st% < 4 THEN GOTO 4150
|
||||
4105 GOSUB 2000
|
||||
4106 IF 0 = wi% THEN GOTO 4140
|
||||
4110 IF wi% = 1 THEN re% = 6: GOTO 4280
|
||||
4115 re% = 4
|
||||
4116 GOTO 4280
|
||||
4140 IF st% = 8 THEN re% = 5: GOTO 4280
|
||||
4150 IF st% AND 1 THEN v% = 2 ELSE v% = 9
|
||||
4160 p% = 0
|
||||
4180 IF 0 <> b%(p%) THEN GOTO 4500
|
||||
4200 IF st% AND 1 THEN b%(p%) = 1 ELSE b%(p%) = 2
|
||||
4210 sp%(st%) = p%
|
||||
4230 sv%(st%) = v%
|
||||
4245 sa%(st%) = al%
|
||||
4246 sb%(st%) = be%
|
||||
4260 st% = st% + 1
|
||||
4270 GOTO 4100
|
||||
4280 st% = st% - 1
|
||||
4290 p% = sp%(st%)
|
||||
4310 v% = sv%(st%)
|
||||
4325 al% = sa%(st%)
|
||||
4326 be% = sb%(st%)
|
||||
4328 b%(p%) = 0
|
||||
4330 IF st% AND 1 THEN GOTO 4340
|
||||
4331 IF re% = 4 THEN GOTO 4530
|
||||
4332 IF re% < v% THEN v% = re%
|
||||
4334 IF v% < be% THEN be% = v%
|
||||
4336 IF be% <= al% THEN GOTO 4520
|
||||
4338 GOTO 4500
|
||||
4340 IF re% = 6 THEN GOTO 4530
|
||||
4341 IF re% > v% THEN v% = re%
|
||||
4342 IF v% > al% THEN al% = v%
|
||||
4344 IF al% >= be% THEN GOTO 4520
|
||||
4500 p% = p% + 1
|
||||
4505 IF p% < 9 THEN GOTO 4180
|
||||
4520 re% = v%
|
||||
4530 IF st% = 0 THEN RETURN
|
||||
4540 GOTO 4280
|
||||
|
Loading…
Reference in New Issue
Block a user