ASIC
David A. Visti's "almost BASIC": a tiny shareware BASIC compiler for MS-DOS, first copyrighted in 1989, that dropped line numbers, compiled straight to COM files a few hundred bytes long, and grew from 40-odd statements to over 90 before its last release, version 5.00, in 1994
Created by David A. Visti
ASIC is a compiler for a small subset of BASIC that ran on MS-DOS. David A. Visti wrote it on his own in Raleigh, North Carolina, and later sold it through his company, 80/20 Software. Its manual’s tagline, “It’s almost BASIC”, was also a fair summary. ASIC left out a lot that other BASICs had: floating point, boolean operators, exponentiation, and for most of its life any expression with more than one operator. In return it compiled a program in a single fast pass, straight to a .COM file that could be only a few hundred bytes long, with no line numbers in the source. From 1989 to 1994 it was passed around BBSes, magazine disks and shareware CD-ROMs, and for some hobbyists it was probably their first compiler.
History & Origins
In the late 1980s every IBM PC owner already had a BASIC, BASICA or GW-BASIC, which came with DOS. Both were interpreters with line numbers. Compiling your programs meant buying something like Microsoft QuickBASIC or Borland Turbo Basic. ASIC was aimed at the gap between those two.
ASIC 1.0 says “Copyright 1989 by David A. Visti”, and its README lists a small package: an editor with a built-in compiler (ASIC.EXE), a command-line compiler (ASICC.EXE), a manual, and one demo program, a Game of Life. The manual calls it a subset of BASICA and GW-BASIC “which supports over 40 BASIC statements, integer and string variables, and integer arrays”. Personal use was free, and only commercial users were asked for $10. The oldest surviving copies of 1.0 carry file dates of late February and early March 1990, so it is not known exactly when in 1989–90 it first went out.
The tutorial in the manual starts by comparing ASIC with GW-BASIC side by side:
| |
Labels end in a colon, up to 80 characters long, and replace line numbers. For many BASIC users of the time, that alone was a reason to switch.
Over the next five years ASIC went through four major versions, each with a dated notes file listing what was new. By 1993 it was published under the name 80/20 Software, still at the same Raleigh P.O. box. The last version, 5.00, is dated 7 August 1994.
Design Philosophy
The 5.00 manual describes ASIC’s design briefly:
ASIC is a single pass compiler written in C (Borland C Version 3.1). Each source statement is translated directly into machine code. ASIC compiles 100% in memory for maximum speed… ASIC generates a minimum of error checking code. This is because the ASIC philosophy stresses execution speed.
Most of ASIC’s quirks follow from that approach. Each statement becomes a short, fixed piece of machine code, so the language is limited to statements that are easy to translate that way:
- One operation per assignment. The operator list gives
A=B*CandA=B+Cas examples. Version 5.00’s GW-BASIC converter shows the limit clearly: it turnsX=Y*Z*Qinto two statements that use a temporary variable,ASIC0@ = Y * Zand thenX = ASIC0@ * Q. - No boolean operators.
AND,ORandNOTdon’t exist, and neither does the^exponent operator. A condition is a single comparison, and<=,<>and>=were only added in 5.00. - Parentheses and commas are ignored. The compatibility chapter says so directly.
A = ABS (B(1))is accepted, and so areA = ABS B 1andA = ABS B 1,,,,,,))))). They are allowed only so that code written in GW-BASIC style still compiles. - Machine-level escape hatches.
CODEinserts raw bytes into the output.INT86(3.00) andGETREGS/SETREGS(5.00) give direct access to DOS and BIOS interrupts and CPU registers.PEEK,POKE,DEFSEGandVARPTRround out the set. For the things ASIC couldn’t do itself, it let you go down to the machine directly. - Size-conscious runtime. Long-integer and decimal support were compile-time options, off by default. The manual notes that long integers add about 475 bytes to a
.COMfile, and it tells you to turn the options off if you don’t need them.
Key Features
Data types
The type of a variable is fixed by the last character of its name, as in older BASICs:
| Suffix | Type | Range | Added |
|---|---|---|---|
| (none) | 16-bit integer | ±32,767 | 1.0 |
$ | string | 0–80 characters | 1.0 |
& | 32-bit long integer | ±2,147,483,647 | 3.00 |
@ | “decimal” fixed point | ±999,999,999,999.99999 | 4.00 |
ASIC never had floating point. The @ decimal type (the manual calls it 64-bit) keeps exactly five decimal places and truncates anything beyond them. The 4.00 notes said it was “more accurate than the floating point type math used in other language products”, meaning it has no binary rounding errors, which suits money calculations. Arithmetic on mixed types follows its own rule, which the manual warns about. ASIC converts the operands to the type of the result before computing. So B=2*2.6 gives 4 in ASIC, where GW-BASIC would give 5.
Control flow
ASIC 1.0 had only GOTO, GOSUB/RETURN, FOR/NEXT and single-line IF ... THEN label:. ASIC 3.00 added block IF/THEN/ELSE/ENDIF and WHILE/WEND, each nestable 25 levels deep. FOR has no STEP and always counts up by 1. Unlike GW-BASIC, a FOR loop always runs its body at least once.
| |
Output formats
Up to version 3.x ASIC produced only .COM files, which are limited to one 64 KB segment for code, data and stack. ASIC 4.00 added two more formats:
- EXE, allowing 64 KB of code plus 64 KB of data and a stack of up to 64 KB, built directly by ASIC without a linker, and
- OBJ, to be linked with the MS-DOS
LINKprogram. ThroughCALL SUB, this allowed assembly routines and, from 5.00, separately compiled ASIC subroutines to be combined into one program. The manual says up to about 500 KB of external object code can be linked this way.
The environment
From the start, ASIC’s main interface was its own editor with the compiler built in, with a separate command-line compiler for people who preferred their own editor. Version 2.0 added a source-level debugger with breakpoints, single-stepping, and viewing and changing variables. Version 3.00 added on-line help for keywords and menus. Version 4.00 added mouse support, file pickers and a DOS shell, and 5.00 added auto-indent and a pop-up ASCII chart.
Hardware access
ASIC was always close to the PC hardware. Version 2.0 added serial-port statements (OPENCOM, COMSTAT, SEND, RECEIVE), which made it practical for terminal-style programs, as well as port I/O with INP and OUT. Graphics began with CGA modes. Version 3.00 added EGA/VGA 16-colour modes and the VGA 320×200 256-colour mode, with PSET, PRESET and POINT taking coordinates in row/column order, the opposite of GW-BASIC.
Hello, World
| |
Compiled as a .COM file, this was the sort of program ASIC turned into an executable of a few hundred bytes. The 4.00 notes describe output “as small as a few hundred bytes”. No size comparison with other compilers appears in the ASIC documentation, but QuickBASIC programs of the time generally needed a runtime library (a separate BRUN module or one linked into the EXE), which made even trivial programs considerably larger.
Evolution
| Version | Date (from the version notes or file dates) | Headline changes |
|---|---|---|
| 1.0 | ©1989; oldest copies dated Feb–Mar 1990 | Editor with built-in compiler, command-line compiler, 40+ statements, integers and strings, COM output |
| 2.0 | 25 Sep 1990 | Debugger, serial ports, READ/DATA, BLOAD/BSAVE, CODE, 60+ statements |
| 3.00 | Summer 1991 | Long integers, block IF, WHILE/WEND, INT86, EGA/VGA, on-line help |
| 3.01 / 3.02 | Sep / Dec 1991 | Point releases |
| 4.00 | 25 Mar 1993 | Decimal type, string arrays, EXE and OBJ output, CALL SUB, mouse |
| 4.01 | c. mid-1994 | Point release |
| 5.00 | 7 Aug 1994 | BAS2ASI converter, ASIC SUB/ENDSUB, <= <> >=, GETREGS/SETREGS, 90+ statements |
The pricing changed along the way. Version 1.0 was free for personal use. Version 2.0 became $10 shareware, and 5.00 asked $20 plus $5 shipping, with a printed manual for another $10. The 5.00 README promises registered users half-price updates. No later update has been found.
The BAS2ASI converter in 5.00 shows how far ASIC remained from GW-BASIC. It splits compound expressions into temporary variables, turns single- and double-precision numbers into ASIC decimals, and marks what it can’t translate with a * so that the compiler stops on it. The converter made moving code to ASIC easier, but not automatic.
Current Relevance
ASIC has not changed since 1994, and 80/20 Software has left no trace since then. The compiler is a 16-bit DOS program. The last manual lists an IBM PC or 100% compatible with 425 KB of free memory as the requirement. Today it runs in DOS emulators and virtual machines rather than on modern operating systems directly. There is no official or community Docker image.
The software itself has survived well. Every major version, from 1.0 to 5.00, is preserved on shareware CD-ROMs from the 1990s. The 5.00 package is on the Internet Archive, and hobbyist pages have kept it available alongside the IBRARY and ASILIB libraries. Rosetta Code has a small ASIC category of about 30 tasks.
Why It Matters
Wikipedia’s article calls ASIC one of the few BASIC compilers that could legally be downloaded from a BBS. For a DOS user in the early 1990s, it was often the cheapest way to get from interpreted GW-BASIC to a real executable. Along the way it showed people some ideas that were still new to them: labels instead of line numbers, block structure, a source-level debugger, and linking against assembly code.
Its limits are also instructive. By keeping only what a single-pass compiler could translate one statement at a time, Visti produced a language that is still recognisably BASIC but is really a readable front end for fairly direct machine code. That explains both the tiny executables and the motto “It’s almost BASIC”.
Timeline
Notable Uses & Legacy
TIPI for the Atari Portfolio
Kent Peterson started TIPI, a small Forth-like stack language for palmtop computers, in December 1992, and wrote its interpreter in ASIC. He wrote in The Palmtop Paper that he chose it over QuickBasic and PowerBasic "because it produces such tiny EXEs", which mattered on a machine as small as the Portfolio
COMPUTE! magazine disk (February 1991)
COMPUTE! chose ASIC for its PC disk in issue 126. It presented ASIC as a cheap way for BASICA and GW-BASIC users to get line-number-free source and compiled COM files, instead of buying QuickBASIC or Power BASIC
IBRARY (Tom Hanlin)
A shareware library of assembly-language routines for ASIC programs by Tom Hanlin. It was linked in through the OBJ output and CALL SUB added in ASIC 4.00, and filled gaps the language itself could not
ASILIB (Douglas Herr)
A larger shareware assembly library for ASIC by Douglas Herr, still offered next to the compiler and IBRARY on hobbyist sites such as John Kiernan's ASIC page