2
[ Software ~eview New BASIC Language Compilers: Microsoft QpickBASIC Borland arb0 Basic Available from: Microsoft Corporation 16011 NE 36th Way Redmond, WA 98073-97017 Borland, International 4585 Scotts Valley Drive Scotts Valley, CA 96066 Though there are many languages used to instruct our computers today, whether we want to admit it or not, there is but one which dominates the installed microcomputer base. A recent national poll found that nearly 83 per- cent of all users program to some degree in BASIC. This language was developed in 1964 to provide an “easy-teuse” lan- guage and therefore one which was also easy to learn. Today this point can still lead to as much discussion as the contention that BASIC contains all the facilities of FORTRAN, Pascal or “C”. What cannot Iw disputed is that BASIC was the primary language first avail- able for the microcomputers and was even included in the ROMs of the Mother lmards of some very common machines. This fact alone gave it a tremendous audience. BASIC now has many forms and niany different suppliers. It re- mains a language well suited for micro- computers because it does easily, and very well, what niost people want on these machines; numerical and file manil~ulation, bp-aphic display and con- venient input and output to a variety of devices. For engineers, specifically, BASIC has not typically been the language of choice. Many of us became computer literate with FORTRAN and firmly de- fend its abilities. BASIC has been slow and did not lend itself well to the nianipulation of large data or numeric arrays. What we sometimes failed to realize was the dramatic evolution that BASIC has gone through in the more than 20 years that it has existed. The two software packages that are review- ed here represent state-of-the art pro- ducts that rival any and all of the present languages used in engineering analysis on microcomputers. They are language compilers which contain many of the strongest facilities of “C”, Pascal and FORTRAN, and retain and enhance the best characteristics of BASIC. BASIC has been used primarily as an “interpretive” language. This implies that a program is loaded into the com- puter IGW BASIC or IBM’s Advanced BASIC) which converts in real time every line of a BASIC program into machine CPU code each and every time that line-of-instructions is encountered. This is a very slow process but lends itself well to immediate debugging and subsequent user interaction. To enhance the speed of execution, BASIC coni- pilers were developed which could convert BASIC source code into com- piled machine lanbuage programs. These compilers work in a fashion identical to the other “high-level” lan- guage mnipilers by producing code which is executed separately from the translator or interpreter. Once the source code is produced with an editor or word processor it is passed through a compiler program to produce object code and then through a seperate link- er program to pull in the necessary machine lanbuage routines from various libraries to make the program complete. With any language the compiling process was time consuming, meticu- lous and often frustrating because of errors and the need to debug and recompile. Even after compiling BASIC never quite compared to other lan- buages because it was limited in the amount of memory it could access. Numerical speed and precision was lacking due lo its inability to make use of math coprocessors such as the 8087 or 80287 in the IBM or MS-DOS nia- chines. Within the past year two competing BASIC compilers have been released which totally eliniinate the previous short-comings of the language and in some respects extend it far tieyond all other “high-level” languages available for the niici-uconiputer. Microsoft Quick- BASIC, Version 3.0 and Borland Turbo Basic, Version 1.0 lapresent enhanced performance BASIC compilers. I was drawn to QuickBASIC because it offered drivers for the Enhanced Graphics Adapter IEGA) and Display. This may not sound significant but for two years IBM had the EGA on the market but never offered BASIC in a form which could take advantage of the higher gaphics resolution or added colors. My alternatives were to learn Pascal or”C” or go through the cunit)ersonie task of eniploying IBM’s Graphic ‘Tool Kit or Kernal System. Them were dozens of programs in interpretive BASIC which I had used in classroom situations or experiniental data acquisition which would have required conversion. QuickBASIC not only offered EGA support but was almost completely compatible with all the p r e grams I had written previously. This implied that I could simply run an ASCII version of my old source code through QuickBASIC, change some graphics commands and they would executed perfectly. Later I purchased Borland”s Turbo Basic which offered nearly everything 18 October 1987

New BASIC Language Compilers: Microsoft QuickBASIC Borland Turbo Basic

  • View
    214

  • Download
    2

Embed Size (px)

Citation preview

[ Software ~eview

New BASIC Language Compilers: Microsoft QpickBASIC Borland a r b 0 Basic

Available from: Microsoft Corporation 16011 NE 36th Way Redmond, WA 98073-97017

Borland, International 4585 Scotts Valley Drive Scotts Valley, CA 96066

Though there are many languages used to instruct our computers today, whether we want to admit it or not, there is but one which dominates the installed microcomputer base. A recent national poll found that nearly 83 per- cent of all users program to some degree in BASIC. This language was developed in 1964 to provide an “easy-teuse” lan- guage and therefore one which was also easy to learn. Today this point can still lead to as much discussion as the contention that BASIC contains all the facilities of FORTRAN, Pascal or “C”.

What cannot Iw disputed is that BASIC was the primary language first avail- able for the microcomputers and was even included in the ROMs of the Mother lmards of some very common machines. This fact alone gave it a tremendous audience. BASIC now has many forms and niany different suppliers. I t re- mains a language well suited for micro- computers because it does easily, and very well, what niost people want on these machines; numerical and file manil~ulation, bp-aphic display and con- venient input and output to a variety of devices.

For engineers, specifically, BASIC has not typically been the language of choice. Many of us became computer literate with FORTRAN and firmly de- fend its abilities. BASIC has been slow and did not lend itself well to the nianipulation of large data or numeric arrays. What we sometimes failed to realize was the dramatic evolution that BASIC has gone through in the more than 20 years that it has existed. The two software packages that are review- ed here represent state-of-the art pro-

ducts that rival any and all of the present languages used in engineering analysis on microcomputers. They are language compilers which contain many of the strongest facilities of “C”, Pascal and FORTRAN, and retain and enhance the best characteristics of BASIC.

BASIC has been used primarily as an “interpretive” language. This implies that a program is loaded into the com- puter IGW BASIC or IBM’s Advanced BASIC) which converts in real time every line of a BASIC program into machine CPU code each and every time that line-of-instructions is encountered. This is a very slow process but lends itself well to immediate debugging and subsequent user interaction. To enhance the speed of execution, BASIC coni- pilers were developed which could convert BASIC source code into com- piled machine lanbuage programs.

These compilers work in a fashion identical to the other “high-level” lan- guage mnipilers by producing code which is executed separately from the translator or interpreter. Once the source code is produced with an editor or word processor it is passed through a compiler program to produce object code and then through a seperate link- er program to pull in the necessary machine lanbuage routines from various libraries to make the program complete.

With any language the compiling process was time consuming, meticu- lous and often frustrating because of errors and the need to debug and recompile. Even after compiling BASIC never quite compared to other lan- buages because it was limited in the amount of memory it could access.

Numerical speed and precision was lacking due lo its inability to make use of math coprocessors such as the 8087 or 80287 in the IBM or MS-DOS nia- chines.

Within the past year two competing BASIC compilers have been released which totally eliniinate the previous short-comings of the language and i n some respects extend it far tieyond all other “high-level” languages available for the niici-uconiputer. Microsoft Quick- BASIC, Version 3.0 and Borland Turbo Basic, Version 1.0 lapresent enhanced performance BASIC compilers. I was drawn to QuickBASIC because it offered drivers for the Enhanced Graphics Adapter IEGA) and Display. This may not sound significant but for two years IBM had the EGA on the market but never offered BASIC in a form which could take advantage of the higher gaphics resolution or added colors. My alternatives were to learn Pascal or”C” or go through the cunit)ersonie task of eniploying IBM’s Graphic ‘Tool Kit or Kernal System.

Them were dozens of programs i n interpretive BASIC which I had used in classroom situations or experiniental data acquisition which would have required conversion. QuickBASIC not only offered EGA support but was almost completely compatible with all the p r e grams I had written previously. This implied that I could simply run an ASCII version of my old source code through QuickBASIC, change some graphics commands and they would executed perfectly.

Later I purchased Borland”s Turbo Basic which offered nearly everything

18 October 1987

that QuickBASIC had as well as a Stan- dard IEEE floating-point numerical for- mat which made use of a 8087 co- processor if present. Recently Microsoft announced Version 3.0 of QuickBASIC which likewise is available with 8087 sul)port. This product release timing illustrates the competition between these two large software developers.

The above mentioned enhancements indicate only those facilities which were significant enough for me to obtain these compilers, they do not represent all the capahilities now availatile in enhanced BASIC compilers. The follow- ing features are presont in hoth Quick- BASIC IV3.0) and Turbo Basic IV1.0):

- Menu-driven file management, edit, compile, run and trace.

- Built-in source-code editor with many text-processing features.

- Compile program to core niem- ory and run or compile to disk.

- Enhance diagnostic and error trappi!ig.

- ’mace or debug code during pro- b p n i execution. Support for nunierous combinations of En- hanced and C:olor Graphic Adap ters and monitors.

Speed enhancement of up to an order of magnitude over inter- pretive BASIC.

- Standard support of sub- routines, user defined functions and enhanced support of sub- programs and mu 1 t i lined fu nc- tions. Elimination ofthe need for each line of code to lie numbered and the inclusion of the ability to use line lahels.

- Portahility of code fiwni true IBM-PC‘s to generic clones.

- Very rapid compilation. -

-

This list can be significantly exten- ded hut the point to he made is that these software packages are very in- clusive of conimands and functions which greatly increase the abilities of this language. Comprehensive reviews of hoth of these pmducts have been coni- pleted 1-6.

With regard to engineering applica- tions of these BASIC compilers, I have found many positive characteristics with both products. The forenlost ad- vantage is the speed with which one can produce code with the text editors,

the speed present in the compilation process, and the speed of execution of the resulting programs. The numerical precision of this lanbuage has heen geatly improved with the support for numeric: coprocessors; however, if the O x 8 i is not present there is a signifi- cant reduction in speed. Douhle-preci- sion floating-point calculations can take up to 30 times longer without a coprocessor in the machine. The con- venience of having the editor, com- piler, debugger, on-line help and file management systeni in one package resident in memory is tremendous. Until you are exposed to such a facility it is difficult to define its usefulness.

There are some weak areas in hoth packages. TUrhoBASIC does not lend itself well to writing code which calls assembly language routines which, were not specifically written with this Borland product in mind. What this nieans is that at this time I cannot “link” assembly language routines or drivers for multifunction hoards used in analog data acquisition. This is a significant protilem in our taboratories and class- rooms where alniost every program written eventually aids in real time data acquisition or analysis.

Microsoft QuickBASIC facilitates this activity hut only tiy piwducing separate object files and suhsequent linking with assembly language liliraries. The resulting QuickBASIC executable pm- gram isquite large and requires the pre- sence of a copyright protected, run- time library. This makes it illegal for the students to leave the la11 with the p m gram they have produced. Ideally one would like to see the ability to link or include compiled routines from other Languages such as FORTRAN or “C” or Assembler into BASIC. Microsoft offeis this facility to a limited extent.

The languages are supplied on a single 360k floppy with an additional disk containing auxilary programs or examples. The manuals which acconi- pany both packages are quite a p p n priate, especially if one has some know- ledge of BASIC. The requirements of the computer system were originally that it have 256k of core, a single floppy disk drive and run MS or PC-DOS, Ver- sion 2.0 or higher. In reality one cannot compile most programs i n core nieni- ory without 512k bytes and two floppy ,drives are almost essential. Both of these languages with documentation

are priced at $99 retail hut can generally he obtained from software outlets for under $70.

In conclusion 1 personally feel that either of these renderings of BASIC rep resents a significant improvement over all programming environments and it will be very difficult for me to rational- ize working in another lanbmage. Also it should he emphasized that it is highly probable that these two products will continue to evolve and he updated. BASIC has a large number of users and Borland and Microsoft are engaged in some very healthy competion to attract these users ilnd new ones.

References 1. Winer, E., “nrbocherg- ing BASIC, Part 1’; Pr: Magazine, 6, (9), 331 (19871. 2. Winer, E., “nrbocharging BASIC, Part 2’; PC Magazine, 6, (ll), 361 (1987). 3. Stewart, G.A., “’Ibrbo BASIC“, Byte Magazine, l2, (31, 101 11987). 4. Winer, E., ‘2 Quick Look A t Quick- BASIC”, PC Magazine, 6, (11, 285 (1987). 5. Petzold, C., “PC 7btorUsing Quick- BASIC with an EGA”, PC Magazine, 6, (91, 403 (19871. 6. Stewart, G.A., “Reviewer”s Notebook”, Byte Magazine, 12, (61, 227 (19871.

I t is the preliminary intent of this series of reviews to emphasize “‘applications” in product discussions. Hopefull-v, in this way the results will be as useful to the “fwst- time” user as to the “seasoned“ expert. I t is extremely important that we have feed- back and assistance form the readers. This will ensure the value of the column and also expand the topics we cover. initial articles will contain product information relevant ot the IBM-PC/XT/AT family because of the availability of these devices to the review editor. It is sincerely hoped that as this column progresses, readers will volunteer their time, equipment and knowledge to aid in the development and range of topics m v e d Individuals willing to do 80 should submit, in writing, a description of their microcomputer and the type of soflware they would be most interested in reviewing. Responses should be sent to:

Professor Terry Richard Dept. of Engineering Mechanics University of Wisconsin-Madison 1415 Johnson Drive Madison. WI.53706