ASIC | |
---|---|
![]() Version 5.0 | |
Original author(s) | Dave Visti |
Developer(s) | 80/20 Software [1] |
Initial release | before 1993 [2] |
Final release | 5.00 / 1994 |
Written in | x86 assembly, Turbo C |
Operating system | MS-DOS |
Type | BASIC |
License | Shareware |
ASIC is a compiler and integrated development environment for a subset of the BASIC programming language. It was released for MS-DOS and compatible systems as shareware. Written by Dave Visti of 80/20 Software, it was one of the few BASIC compilers legally available for download from BBSes. ASIC allows compiling to an EXE or COM file. A COM file for the Hello world program is 360 bytes. [3]
ASIC has little or no support for logical operators, control structures, [4] and floating-point arithmetic. These shortcomings resulted in the tongue-in-cheek motto, "ASIC: It's almost BASIC!" [5] [3]
ASIC is strongly impoverished in comparison with its contemporary BASICs. The features of ASIC are selected to make a program be easily and directly compiled into machine language. Thus, many language constructs of ASIC are equivalent to constructs of assembly language.
Neither identifiers nor keywords are case-sensitive.
Any DIM
statements, if specified, must precede all other statements except REM
statements or blank lines.
All DATA
statements must be placed at the beginning of the program, before all other statement types, except DIM
, REM
statements, or blank lines.
ASIC does not have the exponentiation operator ^
.
ASIC does not have boolean operators (AND
, OR
, NOT
etc.).
The size of array specified in the DIM
statement must be a literal constant. A single DIM
allows declaring only one array.
PRINT
's arguments must be a literal or variable. PRINT
does not allow combined expressions as its arguments, nor strings concatenated with ;
or +
.
If a PRINT
command ends with ;
or ,
, then the next PRINT
command will resume in the position where this one left off, just as though its argument were appended to the argument of the current PRINT
command.
The PRINT
statement prints integer values six characters wide. They are aligned to the right (no trailing spaces).
LOCATE row, column
column
, row
), where 0 ≤ column
and 0 ≤ row
. The position (0, 0) is the upper left corner.PSET (row,column),color
color
at position (column
, row
), where 0 ≤column
and 0 ≤ row
. The position (0, 0) is the upper left corner.A boolean condition may be only a comparison of numbers or strings, but not a comparison of combined expressions. A literal cannot be the left operand of comparison (e.g. can be X = 2
, not 2 = X
).
After THEN
, there may be a sequence of statements delimited by ELSE
or ENDIF
. An example:
IFX<0THENPRINT"Negative"ELSEPRINT"Non-negative"ENDIF
Contrary to other BASICs, statements cannot be put between THEN
and the end of the line.
An if-statement can realize the conditional jump. In this case, after THEN
there may be a label.
In FOR
, after TO
there may be only a number - literal or variable - but not a combined expression. The STEP
clause does not exist in ASIC.
In a GOTO
statement, the label must be followed by a colon.
In a GOSUB
statement, the label must be followed by a colon.
This utility, serving to convert GW-BASIC programs to ASIC syntax, in the version 5.0 does not support some GW-BASIC features. Examples:
STEP
in the for loop is not converted. The program
10FORi=10TO1STEP-120PRINTi30NEXTi
is converted into
REM10FORi=10TO1STEP-1FORI@=10TO1ASIC0@=-1-1I@=I@+ASIC0@REM20PRINTiPRINTI@REM30NEXTiREM30NEXTi3:Syntaxerror
The exponentiation operator ^
is not converted. The program
10a=220b=a^1030PRINTb
is converted into
REM10a=2L10:A@=2REM20b=a^102:SyntaxerrorREM30PRINTbREM30PRINTb3:Syntaxerror