BASIC-80 Language Reference¶
Complete language reference for MBASIC 5.21 (BASIC-80).
Quick Access¶
- Functions - 45 intrinsic functions
- Statements - 77 commands and statements
- Appendices - Error codes, ASCII table, math functions
- Compiled BASIC-80 - Compiler optimizations and code generation
Language Components¶
Functions¶
Built-in functions for mathematical operations, string manipulation, file I/O, and system operations.
Categories: - Mathematical (ABS, SIN, COS, SQR, etc.) - String (LEFT, RIGHT, MID, LEN, etc.) - Type Conversion (CINT, CDBL, STR, VAL, etc.) - File I/O (EOF, LOC, INPUT$, etc.) - System (FRE, PEEK, INP, VARPTR, etc.)
Statements and Commands¶
Programming statements for control flow, I/O, file operations, and program management.
Categories: - Program Control (END, STOP, CLEAR, etc.) - Flow Control (FOR-NEXT, IF-THEN-ELSE, WHILE-WEND, etc.) - Input/Output (INPUT, PRINT, LINE INPUT, etc.) - File I/O (OPEN, CLOSE, GET, PUT, etc.) - Arrays (DIM, ERASE, OPTION BASE) - Error Handling (ON ERROR GOTO, RESUME, etc.)
Operators¶
Arithmetic, comparison, logical, and string operators.
Appendices¶
Additional reference material.
Available: - Error Codes - Complete error reference - ASCII Codes - Character code table - Mathematical Functions - Derived functions
Learning Resources¶
Getting Started¶
- Direct Mode - Execute statements immediately
- Program Mode - Write multi-line programs with line numbers
- Variables - Integer (%), single (!), double (#), string ($)
- Arrays - Multi-dimensional data structures
Common Tasks¶
Input and Output¶
Loops¶
Conditionals¶
File Operations¶
Error Handling¶
10 ON ERROR GOTO 1000
20 REM ... your code here ...
1000 REM Error handler
1010 PRINT "Error"; ERR; "on line"; ERL
1020 RESUME NEXT
Language Features¶
Data Types¶
- Integer (%) - Whole numbers (-32768 to 32767)
- Single Precision (!) - Floating point (~7 digits)
- Double Precision (#) - Floating point (~16 digits)
- String ($) - Text (up to 255 characters)
Operators¶
- Arithmetic:
+,-,*,/,^,\(integer div),MOD - Relational:
=,<>,<,>,<=,>= - Logical:
AND,OR,NOT,XOR,EQV,IMP
Line Numbers¶
- Range: 0 to 65529
- Increment by 10 is standard
- Use RENUM to renumber
Help Navigation¶
- Arrow Keys - Scroll through current page
- Tab - Move to next link
- Enter - Follow link
- U - Go back to previous page
- ESC/Q - Close help
See Also¶
- Functions Index - All functions alphabetically
- Statements Index - All statements alphabetically
- Error Codes - Error reference
- Examples - Sample programs