Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ASIC programming language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 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]]. === Program elements === Neither indetifiers, nor keywords are [[case-sensitive]]. Any <code>DIM</code> statements, if specified, must precede all other statements except <code>REM</code> statements or blank lines. All <code>DATA</code> statements must be placed at the beginning of the program, before all other statement types, except <code>DIM</code>, <code>REM</code> statements, or blank lines). ==== Expressions ==== ASIC does not have the [[exponentiation]] operator <code>^</code>. ASIC does not have [[Boolean expression|boolean]] operators (<code>AND</code>, <code>OR</code>, <code>NOT</code> etc.). === Arrays === The size of [[Array (data structure)|array]] specified in the <code>DIM</code> statement must be a literal constant. A single <code>DIM</code> allows to declare only one array. === Input and output === <code>PRINT</code>'s arguments must be a literal or variable. <code>PRINT</code> does not allow to use combined expressions as its arguments, nor does it allow to use [[String (computer science)|strings]] [[concatenation|concatenated]] with <code>;</code> or <code>+</code>. If a <code>PRINT</code> command ends with <code>;</code> or <code>,</code>, then the next <code>PRINT</code> command will resume in the position where this one left off, just as though its argument were appended to the argument of the current <code>PRINT</code> command. The <code>PRINT</code> statement prints [[Integer (computer science)|integer]] values six characters wide. They are aligned to the right (no trailing spaces). ; <code>LOCATE row, column </code> : Moves the text cursor to the position (<code>column</code>, <code>row</code>), where 0 β€ <code>column</code> and 0 β€ <code>row</code>. The position (0, 0) is the upper left corner. === Graphics === ; <code>PSET (row,column),color</code> : Turns on the pixel of the color <code>color</code> at position (<code>column</code>, <code>row</code>), where 0 β€<code>column</code> and 0 β€ <code>row</code>. The position (0, 0) is the upper left corner. === Control Structures === 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 <code>X = 2</code>, not <code>2 = X</code>). ==== Decisions ==== After <code>THEN</code>, there may be a sequence of statements delimited by <code>ELSE</code> or <code>ENDIF</code>. An example: <syntaxhighlight lang="basic"> IF X < 0 THEN PRINT "Negative" ELSE PRINT "Non-negative" ENDIF </syntaxhighlight> Contrary to other BASICs, statements cannot be put between <code>THEN</code> and the end of the line. An if-statement can realize the conditional jump. In this case, after <code>THEN</code> there may be a label. ==== Looping ==== In <code>FOR</code>, after <code>TO</code> there may be only a number - literal or variable - but not a combined expression. The <code>STEP</code> clause does not exist in ASIC. ==== Branching ==== In a <code>GOTO</code> statement, the label must be followed by a colon. ==== Subroutines ==== In a <code>GOSUB</code> statement, the label must be followed by a colon.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)