The Structure of I-Code
The 'I' in I-Code stands for Intermediate. Intermediate code is code that is a step between interpreted source statements and fully compiled machine code. Typically, intermediate code uses tokens to represent the instructions to be executed. Basic09 I-Code goes a step further by re-arranging the source code instructions in post-fix notation (also known as Reverse Polish Notation) order.
The tokens used by Basic09 are a single byte ranging from $00 to $FF. The table below defines the tokens.
I-Code Token List
| Token !Name !Used In !Description |
|---|
| GLOBAL |Reserved |Global Variable |
| PARAM |Editor | |
| READ |I-Code |File Mode |
| TYPE |Editor | |
| WRITE |I-Code |File Mode |
| DIM |Editor | |
| UPDATE |I-Code |File Mode |
| DATA |I-Code/Editor | |
| EXEC |I-Code |File Mode |
| STOP |I-Code/Editor | |
| READ+EXEC |I-Code |File Mode |
| BYE |I-Code/Editor | |
| WRITE+EXEC |I-Code |File Mode |
| TRON |I-Code/Editor | |
| UPDATE+EXEC |I-Code |File Mode |
| TROFF |I-Code/Editor | |
| PAUSE |I-Code/Editor | |
| DEG |I-Code/Editor | |
| RAD |I-Code/Editor | |
| RETURN |I-Code/Editor | |
| LET |I-Code/Editor | |
| <cva> |I-Code/Editor |Complex Variable Assignment |
| POKE |I-Code/Editor | |
| IF |I-Code/Editor | |
| ELSE |I-Code/Editor | |
| ENDIF |I-Code/Editor | |
| FOR |I-Code/Editor | |
| NEXT |I-Code/Editor | |
| WHILE |I-Code/Editor | |
| ENDWHILE |I-Code/Editor | |
| REPEAT |I-Code/Editor | |
| UNTIL |I-Code/Editor | |
| LOOP |I-Code/Editor | |
| ENDLOOP |I-Code/Editor | |
| EXITIF |I-Code/Editor | |
| ENDEXIT |I-Code/Editor | |
| ON |I-Code/Editor | |
| ERROR |I-Code/Editor | |
| GOTO |Editor |Unbound |
| GOTO |I-Code/Editor |Bound |
| GOSUB |Editor |Unbound |
| GOSUB |I-Code/Editor |Bound |
| RUN |I-Code/Editor | |
| KILL |I-Code/Editor | |
| INPUT |I-Code/Editor | |
| PRINT |I-Code/Editor |? Becomes PRINT in the Editor |
| CHD |I-Code/Editor | |
| CHX |I-Code/Editor | |
| CREATE |I-Code/Editor | |
| OPEN |I-Code/Editor | |
| SEEK |I-Code/Editor | |
| READ |I-Code/Editor | |
| WRITE |I-Code/Editor | |
| GET |I-Code/Editor | |
| PUT |I-Code/Editor | |
| CLOSE |I-Code/Editor | |
| RESTORE |I-Code/Editor | |
| DELETE |I-Code/Editor | |
| CHAIN |I-Code/Editor | |
| SHELL |I-Code/Editor | |
| BASE 0 |I-Code/Editor | |
| BASE 1 |I-Code/Editor | |
| REM |Editor |! Becomes REM in the Editor |
| (* |Editor | |
| END |I-Code/Editor | |
| <ulrf> |I-Code/Editor |Unbound Line Reference |
| <blrf> |I-Code/Editor |Bound Line Reference |
| <dex> |I-Code/Editor |Direct Execution |
| PROCEDURE |Editor |Procedure start |
| <erl> |Editor/Debug |Error Line |
| \ |I-Code/Editor |End-of-Instruction, Continue Line |
| <eol> |I-Code/Editor |End-of-Instruction and Line |
| BYTE |Editor | |
| fbyte |I-Code/Editor |VDT Entry, Field Byte Variable |
| INTEGER |Editor | |
| finteger |I-Code/Editor |VDT Entry, Field Integer Variable |
| REAL |Editor | |
| freal |I-Code/Editor |VDT Entry, Field Real Variable |
| BOOLEAN |Editor | |
| fboolean |I-Code/Editor |VDT Entry, Field Boolean Variable |
| STRING |Editor | |
| fstring |I-Code/Editor |VDT Entry, Field String Variable |
| THEN |I-Code/Editor | |
| frecord |I-Code/Editor |VDT Entry, Field Record Variable |
| TO |I-Code/Editor | |
| STEP |I-Code/Editor | |
| DO |I-Code/Editor | |
| fvectorb |I-Code/Editor |VDT Entry, Field 1 Dimensional Byte Array |
| USING |I-Code/Editor | |
| fvectori |I-Code/Editor |VDT Entry, Field 1 Dimensional Integer Array |
| : |I-Code/Editor |File Mode Operator |
| fvectorr |I-Code/Editor |VDT Entry, Field 1 Dimensional Real Array |
| , |I-Code/Editor |Comma Separator |
| fvectorl |I-Code/Editor |VDT Entry, Field 1 Dimensional Boolean Array |
| : |I-Code/Editor |Colon |
| fvectors |I-Code/Editor |VDT Entry, Field 1 Dimensional String Array |
| ( |I-Code/Editor |Left Parenthesis |
| fvectoru |I-Code/Editor |VDT Entry, Field 1 Dimensional Record Array |
| ) |I-Code/Editor |Right Parenthesis |
| [ |I-Code/Editor |Left Bracket |
| ] |I-Code/Editor |Right Bracket |
| ftableb |I-Code/Editor |VDT Entry, Field 2 Dimensional Byte Array |
| ; |I-Code/Editor |Semi-colon |
| ftablei |I-Code/Editor |VDT Entry, Field 2 Dimensional Integer Array |
| := |I-Code/Editor |Assignment Operator |
| ftabler |I-Code/Editor |VDT Entry, Field 2 Dimensional Real Array |
| = |I-Code/Editor |Assignment Operator |
| ftablel |I-Code/Editor |VDT Entry, Field 2 Dimensional Boolean Array |
| # |I-Code/Editor |Channel (Path) Number Operator |
| ftables |I-Code/Editor |VDT Entry, Field 2 Dimensional String Array |
| <ivgt> |I-Code/Editor |Invisible GOTO (used with IF) |
| ftableu |I-Code/Editor |VDT Entry, Field 2 Dimensional Record Array |
| |Unused | |
| |Unused | |
| fmatrixb |I-Code/Editor |VDT Entry, Field 3 Dimensional Byte Array |
| fmatrixi |I-Code/Editor |VDT Entry, Field 3 Dimensional Integer Array |
| fmatrixr |I-Code/Editor |VDT Entry, Field 3 Dimensional Real Array |
| fmatrixl |I-Code/Editor |VDT Entry, Field 3 Dimensional Boolean Array |
| fmatrixs |I-Code/Editor |VDT Entry, Field 3 Dimensional String Array |
| fmatrixu |I-Code/Editor |VDT Entry, Field 3 Dimensional Record Array |
| |Unused | |
| |Unused | |
| byte |I-Code/Editor |VDT entry, Byte Variable |
| integer |I-Code/Editor |VDT entry, Integer Variable |
| real |I-Code/Editor |VDT entry, Real Variable |
| boolean |I-Code/Editor |VDT entry, Boolean Variable |
| string |I-Code/Editor |VDT entry, String Variable |
| record |I-Code/Editor |VDT entry, Record Variable |
| |Unused | |
| |Unused | |
| vectorb |I-Code/Editor |VDT Entry, 1 Dimensional Byte Array |
| vectori |I-Code/Editor |VDT Entry, 1 Dimensional Integer Array |
| vectorr |I-Code/Editor |VDT Entry, 1 Dimensional Real Array |
| vectorl |I-Code/Editor |VDT Entry, 1 Dimensional Boolean Array |
| vectors |I-Code/Editor |VDT Entry, 1 Dimensional String Array |
| vectoru |I-Code/Editor |VDT Entry, 1 Dimensional Record Array |
| |Unused | |
| |Unused | |
| tableb |I-Code/Editor |VDT Entry, 2 Dimensional Byte Array |
| tablei |I-Code/Editor |VDT Entry, 2 Dimensional Integer Array |
| tabler |I-Code/Editor |VDT Entry, 2 Dimensional Real Array |
| tablel |I-Code/Editor |VDT Entry, 2 Dimensional Boolean Array |
| tables |I-Code/Editor |VDT Entry, 2 Dimensional String Array |
| tableu |I-Code/Editor |VDT Entry, 2 Dimensional Record Array |
| |Unused | |
| |Unused | |
| matrixb |I-Code/Editor |VDT Entry, 3 Dimensional Byte Array |
| matrixi |I-Code/Editor |VDT Entry, 3 Dimensional Integer Array |
| matrixr |I-Code/Editor |VDT Entry, 3 Dimensional Real Array |
| matrixl |I-Code/Editor |VDT Entry, 3 Dimensional Boolean Array |
| matrixs |I-Code/Editor |VDT Entry, 3 Dimensional String Array |
| matrixu |I-Code/Editor |VDT Entry, 3 Dimensional Record Array |
| |Unused | |
| |Unused | |
| byte |I-Code/Editor |Instruction, Simple Byte Variable |
| pbyte |I-Code/Editor |VDT Entry, Parameter Byte Variable |
| DIR |I-Code |File Mode |
| integer |I-Code/Editor |Instruction, Simple Integer Variable |
| pinteger |I-Code/Editor |VDT Entry, Parameter Integer Variable |
| READ+DIR |I-Code |File Mode |
| real |I-Code/Editor |Instruction, Simple Real Variable |
| preal |I-Code/Editor |VDT Entry, Parameter Real Variable |
| WRITE+DIR |I-Code |File Mode |
| boolean |I-Code/Editor |Instruction, Simple Boolean Variable |
| pboolean |I-Code/Editor |VDT Entry, Parameter Boolean Variable |
| UPDATE+DIR |I-Code |File Mode |
| string |I-Code/Editor |Instruction, Simple String Variable |
| pstring |I-Code/Editor |VDT Entry, Parameter String Variable |
| EXEC+DIR |I-Code |File Mode |
| record/p |I-Code/Editor |Instruction, Record, Parameter (Simple/Record) Variable |
| vector/p |I-Code/Editor |Instruction, 1 Dimensional Array, Parameter 1 Dimensional Array Variable |
| table/p |I-Code/Editor |Instruction, 2 Dimensional Array, Parameter 2 Dimensional Array Variable |
| matrix/p |I-Code/Editor |Instruction, 3 Dimensional Array, Parameter 3 Dimensional Array Variable |
| precord |I-Code/Editor |VDT Entry, Parameter Record Variable |
| READ+EXEC+DIR |I-Code |File Mode |
| vector/p |I-Code/Editor |Instruction, 1 Dimensional Array |
| WRITE+EXEC+DIR |I-Code |File Mode |
| table/p |I-Code/Editor |Instruction, 2 Dimensional Array |
| UPDATE+EXEC+DIR |I-Code |File Mode |
| matrix/p |I-Code/Editor |Instruction, 3 Dimensional Array |
| pvectorb |I-Code/Editor |VDT Entry, Parameter 1 Dimensional Byte Array |
| varm |I-Code/Editor |Instruction, Simple/Record Variable Mirror |
| pvectori |I-Code/Editor |VDT Entry, Parameter 1 Dimensional Integer Array |
| fvectorm |I-Code/Editor |VDT Entry, Field 1 Dimensional Array Mirror |
| pvectorr |I-Code/Editor |VDT Entry, Parameter 1 Dimensional Real Array |
| ftablem |I-Code/Editor |VDT Entry, Field 2 Dimensional Array Mirror |
| pvectorl |I-Code/Editor |VDT Entry, Parameter 1 Dimensional Boolean Array |
| fmatrixm |I-Code/Editor |VDT Entry, Field 3 Dimensional Array Mirror |
| pvectors |I-Code/Editor |VDT Entry, Parameter 1 Dimensional String Array |
| <blit> |I-Code/Editor |BYTE Constant (Literal) |
| pvectoru |I-Code/Editor |VDT Entry, Parameter 1 Dimensional Record Array |
| <ilit> |I-Code/Editor |INTEGER Constant (Literal) |
| <rlit> |I-Code/Editor |REAL Constant (Literal) |
| " |I-Code/Editor |STRING Constant - Beginning (Literal) |
| ptableb |I-Code/Editor |VDT Entry, Parameter 2 Dimensional Byte Array |
| $ |I-Code/Editor |Hexadecimal Constant (Literal) |
| ptablei |I-Code/Editor |VDT Entry, Parameter 2 Dimensional Integer Array |
| ADDR() |I-Code/Editor | |
| ptabler |I-Code/Editor |VDT Entry, Parameter 2 Dimensional Real Array |
| |I-Code/Editor |Second Byte of ADDR() |
| ptablel |I-Code/Editor |VDT Entry, Parameter 2 Dimensional Boolean Array |
| SIZE() |I-Code/Editor | |
| ptables |I-Code/Editor |VDT Entry, Parameter 2 Dimensional String Array |
| |I-Code/Editor |Second Byte of SIZE() |
| ptableu |I-Code/Editor |VDT Entry, Parameter 2 Dimensional Record Array |
| POS() |I-Code/Editor | |
| ERR() |I-Code/Editor | |
| MOD() |I-Code/Editor |Byte/Integer |
| pmatrixb |I-Code/Editor |VDT Entry, Parameter 3 Dimensional Byte Array |
| MOD() |I-Code/Editor |Real |
| pmatrixi |I-Code/Editor |VDT Entry, Parameter 3 Dimensional Integer Array |
| RND() |I-Code/Editor | |
| pmatrixr |I-Code/Editor |VDT Entry, Parameter 3 Dimensional Real Array |
| PI |I-Code/Editor | |
| pmatrixl |I-Code/Editor |VDT Entry, Parameter 3 Dimensional Boolean Array |
| SUBSTR() |I-Code/Editor | |
| pmatrixs |I-Code/Editor |VDT Entry, Parameter 3 Dimensional String Array |
| SGN() |I-Code/Editor | |
| pmatrixu |I-Code/Editor |VDT Entry, Parameter 3 Dimensional Record Array |
| SGN() |I-Code/Editor | |
| SIN() |I-Code/Editor | |
| COS() |I-Code/Editor | |
| <subr> |I-Code/Editor |Called Subroutine Name |
| TAN() |I-Code/Editor | |
| ASN() |I-Code/Editor | |
| ACS() |I-Code/Editor | |
| ATN() |I-Code/Editor | |
| EXP() |I-Code/Editor | |
| ABS() |I-Code/Editor | |
| ABS() |I-Code/Editor | |
| LOG() |I-Code/Editor | |
| LOG10() |I-Code/Editor | |
| SQRT() |I-Code/Editor | |
| SQR() |I-Code/Editor |Becomes SQRT() in the Code |
| INT() |I-Code/Editor |Byte/Integer |
| INT() |I-Code/Editor |Real |
| FIX() |I-Code/Editor |Byte/Integer |
| FIX() |I-Code/Editor |Real |
| FLOAT() |I-Code/Editor |Byte/Integer |
| FLOAT() |I-Code/Editor |Real |
| SQ() |I-Code/Editor |Byte/Integer |
| SQ() |I-Code/Editor |Real |
| PEEK() |I-Code/Editor | |
| LNOT() |I-Code/Editor |Logical NOT |
| VAL() |I-Code/Editor | |
| LEN() |I-Code/Editor | |
| ASC() |I-Code/Editor | |
| LAND() |I-Code/Editor |Logical AND |
| LOR() |I-Code/Editor |Logical OR |
| LXOR() |I-Code/Editor |Logical XOR |
| TRUE |I-Code/Editor | |
| FALSE |I-Code/Editor | |
| EOF() |I-Code/Editor | |
| TRIM$() |I-Code/Editor | |
| MID$() |I-Code/Editor | |
| LEFT$() |I-Code/Editor | |
| RIGHT$() |I-Code/Editor | |
| CHR$() |I-Code/Editor | |
| STR$() |I-Code/Editor |Byte/Integer |
| STR$() |I-Code/Editor |Real |
| DATE$ |I-Code/Editor | |
| TAB |I-Code/Editor | |
| <ritc> |I-Code/Editor |Real->Byte/Integer Type Conversion |
| <fix1> |I-Code/Editor |Fix Top of Stack |
| <fix2> |I-Code/Editor |Fix Second on Stack |
| <fix3> |I-Code/Editor |Fix Third on Stack |
| <irtc> |I-Code/Editor |Byte/Integer->Real Type Conversion |
| <flt1> |I-Code/Editor |Float Top of Stack |
| <flt2> |I-Code/Editor |Float Second on Stack |
| NOT() |I-Code/Editor | |
| - |I-Code/Editor |(Monadic) Negate Byte/Integer |
| - |I-Code/Editor |(Monadic) Negate Real |
| AND |I-Code/Editor | |
| OR |I-Code/Editor | |
| XOR |I-Code/Editor | |
| > |I-Code/Editor |Byte/Integer Comparison Operator |
| > |I-Code/Editor |Real Comparison Operator |
| > |I-Code/Editor |String Comparison Operator |
| < |I-Code/Editor |Byte/Integer Comparison Operator |
| < |I-Code/Editor |Real Comparison Operator |
| < |I-Code/Editor |String Comparison Operator |
| <> |I-Code/Editor |Byte/Integer Comparison Operator >< is converted to <> in the code |
| <> |I-Code/Editor |Real Comparison Operator >< is converted to <> in the code |
| <> |I-Code/Editor |String Comparison Operator >< is converted to <> in the code |
| <> |I-Code/Editor |Boolean Comparison Operator >< is converted to <> in the code |
| = |I-Code/Editor |Byte/Integer Comparison Operator |
| = |I-Code/Editor |Real Comparison Operator |
| = |I-Code/Editor |String Comparison Operator |
| = |I-Code/Editor |Boolean Comparison Operator |
| >= |I-Code/Editor |Byte/Integer Greater/Equal Operator |
| >= |I-Code/Editor |Real Greater/Equal Operator |
| >= |I-Code/Editor |String Greater/Equal Operator |
| <= |I-Code/Editor |Byte/Integer Less/Equal Operator |
| <= |I-Code/Editor |Real Less/Equal Operator |
| <= |I-Code/Editor |String Less/Equal Operator |
| + |I-Code/Editor |Byte/Integer Add Operator |
| + |I-Code/Editor |Real Add Operator |
| + |I-Code/Editor |String Concantenate Operator |
| - |I-Code/Editor |Byte/Integer Subtract Operator (Dyadic) |
| - |I-Code/Editor |Real Subtract Operator (Dyadic) |
| * |I-Code/Editor |Byte/Integer Multiply Operator |
| * |I-Code/Editor |Real Multiply Operator |
| / |I-Code/Editor |Byte/Integer Divide Operator |
| / |I-Code/Editor |Real Divide Operator |
| ^ |I-Code/Editor |Exponent Operator |
| ** |I-Code/Editor |Exponent Operator |
| varm/p |I-Code/Editor |Instruction, Simple/Record, Parameter Variable Mirror |
| vectorm/p |I-Code/Editor |Instruction, 1 Dimensional Array, Parameter 1 Dimensional Array Mirror |
| tablem/p |I-Code/Editor |Instruction, 2 Dimensional Array, Parameter 2 Dimensional Array Mirror |
| matrixm/p |I-Code/Editor |Instruction, 3 Dimensional Array, Parameter 3 Dimensional Array Mirror |
| field |I-Code/Editor |Instruction, Field Variable |
| UPDATE |Editor | |
| fvector |I-Code/Editor |Instruction, Field 1 Dimensional Array |
| EXEC |Editor | |
| ftable |I-Code/Editor |Instruction, Field 2 Dimensional Array |
| DIR |Editor | |
| fmatrix |I-Code/Editor |Instruction, Field 3 Dimensional Array |
| |Unused | |
| |Unused | |
| |Unused | |
| |Unused | |
| |Unused | |
| " |I-Code/Editor |STRING Constant - Terminator |