ASIC is a compiler and
integrated development environment
An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools a ...
for a subset of the
BASIC
BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
programming language. It was released for
MS-DOS
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few oper ...
and compatible systems as
shareware
Shareware is a type of proprietary software that is initially shared by the owner for trial use at little or no cost. Often the software has limited functionality or incomplete documentation until the user sends payment to the software developer ...
. Written by Dave Visti of 80/20 Software, it was one of the few BASIC compilers legally available for
download
In computer networks, download means to ''receive'' data from a remote system, typically a server such as a web server, an FTP server, an email server, or other similar system. This contrasts with uploading, where data is ''sent to'' a remo ...
from
BBSes. ASIC allows compiling to an
EXE
Exe or EXE may refer to:
* .exe, a file extension
* exe., abbreviation for executive
Places
* River Exe, in England
* Exe Estuary, in England
* Exe Island, in Exeter, England
Transportation and vehicles
* Exe (locomotive), a British locomotive ...
or
COM file
A COM file is a type of simple executable file. On the Digital Equipment Corporation (DEC) VAX operating systems of the 1970s, .COM was used as a filename extension for text files containing commands to be issued to the operating system (sim ...
. A COM file for
Hello world program
''Hello'' is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses
''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich ...
is 360 bytes.
ASIC has little or no support for
logical operator
In logic, a logical connective (also called a logical operator, sentential connective, or sentential operator) is a logical constant. They can be used to connect logical formulas. For instance in the syntax of propositional logic, the binary ...
s,
control structure
In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an ''imp ...
s, and
floating-point arithmetic
In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can b ...
. These shortcomings resulted in the tongue-in-cheek motto, "ASIC: It's almost BASIC!"
ASIC is the work of David Visti and his compiler takes code that is "almost BASIC" and compiles it down to a very small executable.
, Programmer's Corner: TIPI: A Small Programming Language for Small Comp, By Kent Peterson[ASIC]
Area code magic with AC Hunter (computer program) (On Disk) (evaluation), by George Campbell, COMPUTE! ISSUE 126 / FEBRUARY 1991 / PAGE 86
Features
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.
Expressions
ASIC does not have the exponentiation
Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
operator ^
.
ASIC does not have boolean
Any kind of logic, function, expression, or theory based on the work of George Boole is considered Boolean.
Related to this, "Boolean" may refer to:
* Boolean data type, a form of data with only two possible values (usually "true" and "false" ...
operators (AND
, OR
, NOT
etc.).
Input and Output
PRINT
's arguments must be a literal or variable. PRINT
does not allow to use combined expressions as its arguments, nor does it allow to use strings concatenated
In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalisations of concatenatio ...
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.
; LOCATE row, column
: Moves the text cursor to the position (column
, row
), where 0 ≤ column
and 0 ≤ row
. The position (0, 0) is the upper left corner.
Graphics
; PSET (row,column),color
: Turns on the pixel of the color color
at position (column
, row
), where 0 ≤column
and 0 ≤ row
. The position (0, 0) is the upper left corner.
Control Structures
Decisions
A boolean condition in IF
may be only a comparison of numbers or strings, but not a comparison of combined expressions.
After THEN
, there may be a sequence of statements delimited by ELSE
or ENDIF
. An example:
IF X < 0 THEN
PRINT "Negative"
ELSE
PRINT "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.
Looping
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.
Branching
In a GOTO
statement, the label must be followed by a colon.
Subroutines
In a GOSUB
statement, the label must be followed by a colon.
BAS2ASI
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
In computer science a for-loop or for loop is a control flow statement for specifying iteration. Specifically, a for loop functions by running a section of code repeatedly until a certain condition has been satisfied.
For-loops have two par ...
is not converted. The program
10 FOR i=10 TO 1 STEP -1
20 PRINT i
30 NEXT i
is converted into
REM 10 FOR i=10 TO 1 STEP -1
FOR I@ = 10 TO 1
ASIC0@ = -1 -1
I@ = I@ + ASIC0@
REM 20 PRINT i
PRINT I@
REM 30 NEXT i REM 30 NEXT i 3: Syntax error
The exponentiation
Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
operator ^
is not converted. The program
10 a=2
20 b=a^10
30 PRINT b
is converted into
REM 10 a=2
L10:
A@ = 2
REM 20 b=a^10
2: Syntax error
REM 30 PRINT b REM 30 PRINT b 3: Syntax error
References
External links
ASIC 5.00 + Libraries + Linker
ASIC
Tasks implemented in ASIC o
rosettacode.org
{{BASIC
BASIC programming language family