BASCOMP 2.2
What’s New in 2.2
Welcome to another release of BASCOMP! The compiler has been further optimized. Binary size stays at around 63 KB, but more functions are available and compiling/assembling speed of the toolchain has been improved.
Toolchain performance improved
BASM is now noticeably faster due to an optimization in phase 1. This improves the overall build experience, especially when repeatedly compiling larger BASCOMP-generated assembler sources.
Location/path awareness
BASCOMP now supports and uses the PROGDIR$ directive, returning the working path of the program that is currently being executed. This specifically enables BASCOMP to be called from various locations within your local file system.
Constant folding
BASCOMP will now try to fold pure numerical expressions (like 2+(3-4)*8) and output just the result. This can save several dozen to hundreds of bytes if you use mathematical formulas. Note that BASCOMP is still bound to integer numbers (no floating point processing).
Experimental support for quitting programs using Ctrl-C
Breaking routines have been added and will be involved during FOR/WHILE-Loops and INPUT$/INKEY$. This will enable you to quit running programs by using Ctrl-C under most circumstances. Mind that you can still program unquittable endless loops like: "10 GOTO 10".
Updated supported language features
See the wiki page for details: Supported functions and statements Notably, the following items have been added:
New string-producing functions
BASCOMP 2.2 adds support for additional string-producing functions:
- HEX$(number), converting a 16-bit value to uppercase hexadecimal text without leading zeroes.
- SPACE$(count), creating a string containing spaces.
- STRING$(count, charCode), creating a repeated-character string.
These extend the existing string expression support and are handled through the runtime string helper routines.
Improved CIRCLE support
CIRCLE has been extended with an optional aspect parameter. This allows drawing aspect-scaled ellipses in addition to ordinary outline circles. Internally, an aspect value of 256 represents a 1.0 scaling factor.
END now supports an optional errorlevel
END can now be used with an optional numeric expression, such as "END 1" .Without an argument, END terminates the program normally. With an argument, the value is passed as the DOS program exit code ("ERRORLEVEL").