Repository navigation
Release 4.8
FastBasic has functions!
This is a long overdue release. The main language addition is user-defined integer functions, complemented by floating-point DATA arrays and a large compiler/optimizer cleanup.
Language changes:
-
Adds user-defined integer functions. A PROC can return a value with
RETURN expression, and the function is called from any integer expression with@name(...):PROC Square X RETURN X*X ENDPROC ? @Square(5)Calls support nested and recursive functions.
-
RETURNcan also be used without a value, as an early exit from a PROC. Active FOR loops are unwound before returning. -
Adds floating-point DATA arrays. Use a name ending in
%:DATA values%() = 1.0, 2.5, 3.75The elements can be read and written like other arrays.
-
%()can now be used on the left side of an assignment, allowing floating-point values to be stored through an address:%(1536) = 0.1234 -
INPUTnow works correctly with BYTE and floating-point DATA arrays. -
ENDPROCcan now be abbreviated asEN.. If anIFis open,EN.closes the IF first, as before.
IDE and Atari compiler changes:
- The native parser now reports an error for source lines longer than 255 characters instead of looping.
- More parser and code-size optimizations; the integer IDE remains below 8 KB.
EN.abbreviation support is available in the native compiler too.
Fixes:
- Fixes the cross compiler's floating-point SIN/COS link failure.
- Fixes
COLOR()tracking when PRINT statements are shortened by the optimizer. - Fixes
INPUTinto BYTE and floating-point DATA arrays. - Fixes
-lslistings to use exactly the requested line width and to keep EOL bytes inside strings. - Fixes ordering of DATA and PROC blocks declared on the same line in the cross compiler.
- Fixes the Windows test-runner build with newer MinGW and updates CI to the current Windows runner.
Cross Compiler:
- New pattern-based peephole optimizer with many additional rules. The test suite now checks that every peephole rule is reached.
- Constant-address POKE expressions, including symbolic byte addresses, are folded into compact
NUM_POKE/BYTE_POKEforms. - INPUT directly into a variable no longer builds and stores a temporary address.
- Unnecessary SADDR save/restore pairs around function calls are removed.
VAR = VAR + 1is compiled toINC VAR; other common expression sequences are also simplified.- Function calls now produce a compile error when the target PROC has no value-returning RETURN.
- Listing fixes and stable DATA/PROC ordering.
Documentation and tests:
- Manual updated for functions,
RETURN,EN., floating-point DATA and%()assignment. - Cross-compiler manual clarifications.
- New editor test harness with 51 editor tests using the full mini65
E:emulation; the complete suite now has 161 tests.