Contract Services Associates

For FINAL solutions

Circle 532 on Reader Service card

Multifunction

Multi-Basic

The Multi-Basic Compiler runs on the Models I. Ill (48K). and 4 (64K) and requires two disk drives. Alcor Systems. 1132 Commerce Drive. Richardson. TX 75081. $89.95 for one version. $110.95 for two. and $131.95 for all three. Easy to use: ir ir ir * ir Good docs: ★ ★ ★ ★ -£r Bug free: * * ★ it it Does the job: ir ir ir ir it

Alcor Systems' Multi-Basic adds some interesting new twists to Basic compilers. Not only can it compile both Microsoft Basic and CBasic (CP/M) programs, it lets you extend Basic's capabilities by supporting user-defined procedures and functions. And you can write programs developed under Multi-Basic as a collection of separate program modules in a Pascal-like fashion while retaining Basic's versatility. Although Multi-Basic exhibits a few problems, it is a superior compiler.

The Multi-Basic System

The Alcor system comes on TRSDOS data disks, with patch files included for the LDOS (I/III), NEWDOS/8O (I/III). MULTIDOS (I/III). and DOSPLUS (I/III/4) operating systems. While the disks contain an extensive number of programs, the Multi-Basic system comprises only six major programs: a text editor, compiler. optimizer, code generator, run utility. and linking loader.

Alcor's full-screen text editor supports numerous features, including character insertion and deletion: line insertion, deletion, duplication, split, and merge; block insertion and deletion; tab setting and clearing; string search and replacement; automatic indentation; and more. Although the manual provides full explanations for the editor, three on-line help files provide quick references.

Because of memory limitations on the Models I and III, the compiler (called MU-BAS) runs a series of program overlays during program compilation. The Model 4 version of MUBAS works as a standalone compiler for small and medium-length programs and as an overlayed compiler for longer ones.

You have to save your files in ASCII format to compile them. Also, you must make each program line fewer than 256 characters long and include leading and trailing spaces with all Basic key words.

Although Model 4 Basic programs meet these spacing requirements, you have to modify Model I/III programs. Alcor supplies a utility to make the necessary changes.

MUBAS compiles a Basic program in one pass and generates a pseudo-code (p-code). Because it generates the p-code in this single pass, the code isn't as efficient as it could be. Therefore. Alcor includes a p-code optimizer to reduce a compiled program's size by 10 to 30 percent.

You can increase a compiled program's execution speed by translating the p-code into machine language with the code generator provided (CODE-GEN). Although CODEGEN can greatly increase execution speed, the resultant machine-language program will be from two to three times larger than the original p-code. While machine code translation of entire programs is sometimes impractical, you can realize substantial increases in execution speed by translating carefully selected program modules.

Once you compile a program, you can easily test it with either the BRuntime utility or the linking loader (Linkload). Besides executing a program. Linkload can generate /CMD files of compiled programs. Multi-Basic produces /CMD files by linking the program modules with any necessary machine-language routines. the library routines, and the run time support overlay.

Alcor provides two different run time support overlays: Runtime/OVY and BRuntime/OVY. While Runtime/OVY supports Multi-Basic modules only. BRuntime/OVY provides additional support for Alcor Pascal and Alcor C program modules.

Basic Support

Multi-Basic supports almost all Microsoft Basic key words, with a few minor differences. In addition, it supports a number of predefined procedures and functions (see Fig. 1) that you must declare as externals to use within a program.

As mentioned, Multi-Basic also supports user-defined procedures and functions. including nesting, local and global variables, local error-trapping, and recursion. Some of its other features include unlimited string size, no string garbage collection delays, only referenced program lines with line numbers or descriptive labels, and variable names of up to 255 characters.

Incompatibilities and Bugs

Although many programs compile correctly, a few incompatibilities exist between Multi-Basic and the TRS-80 versions of Microsoft Basic. Under TRS-80 Basic, single- and double-precision numbers can represent values in the range of

+1 0

Post a comment