Short: AmigaBasic Compiler Enhanced (ACE) Author: Manfred Bergmann Uploader: manfred bergmann me com Type: dev/basic Version: 2.8.0 Replaces: ace-basic Requires: OS2.0+ Architecture: m68k-amigaos >= 2.0 Distribution: Aminet URL: https://github.com/mdbergmann/ACEBasic CHANGELOG ========= v2.8.0 (2026-02-09) ------------------- New Features: - INVOKABLE Keyword: New SUB modifier for closures used as callbacks. SUBs declared with INVOKABLE can be passed via BIND and correctly invoked through function pointers with runtime CLSR detection in both expression and statement contexts. - YAP Preprocessor: New BASIC preprocessor (Yet Another Preprocessor) replacing the legacy APP. Supports #define/#undef macros, #ifdef/ #ifndef/#else/#endif conditionals, #include "file" and #include with nested includes (up to 8 levels), include-once tracking, -D/-U CLI options, and -I include path. Written in ACE BASIC. - List Submodule: Lisp-style linked list library (submods/list/) with typed cons cells supporting INTEGER, SINGLE, STRING, and ADDRESS values. Lists are effectively immutable when only non-destructive functions are used. Includes higher-order functions (LMap, LFilter, LReduce, LForEach) using closures/INVOKABLE. Comprehensive test suite with 190+ assertions. - REM #using Directive (#47): Source files can now declare object file dependencies with REM #using . The bas script automatically parses these and links the specified object files. - Installer (#32): AmigaDOS Installer script (Install-ACE) for end-user installation with Cubic icons. New Submodules: - list.b: Lisp-style linked list with higher-order function support. Changes: - 68000 Runtime Libraries: Separate runtime libraries (db.lib, startup.lib) for 68000 targets, alongside the default 68020 builds. - Removed Legacy APP Preprocessor: The old C-based APP preprocessor source has been removed in favor of YAP. - Deprecated ACPP and NAP: The C-comment preprocessor (ACPP) and NAP preprocessor are deprecated. YAP supersedes both (influenced by NAP's design) and provides a unified preprocessing solution. - CubicIDE Integration: Added CubicIDE ACE plugin and IDE folder. Bug Fixes: - Fix Assembler Label Suffixes (#44): Type qualifier characters (%, &, !, #, $) in SUB/FUNCTION names are now mapped to portable assembler-safe suffixes (_IS, _IL, _FS, _FD, _ST) for vasm compatibility. - Fix INVOKE in Statement Context: INVOKE with runtime CLSR detection now works correctly in statement context (previously only worked in expression context). - Fix REM #using with No Directives (#47): The bas script no longer errors when source files contain no REM #using directives. Compiler Internals: - Major refactoring (#55): Extracted codegen.c module with reusable code generation helpers (gen_rt_call, gen_frame_addr, gen_push, gen_pop, gen_lib_call, gen_var_addr, etc.). Broke up large functions (statement, factor, compile, insymbol, for_statement) into focused handlers. Extracted invoke.c for SUB/FUNCTION call handling. Total reduction of ~1500 lines of duplicated code. Testing: - 60 new test cases across 10 categories (strings, math, logic, fileio, memory, control, syntax, subs, arithmetic, errors). - Recursion test suite (7 tests). - YAP preprocessor test suite (11 tests covering all features). Documentation: - Internal calling conventions document (AmigaGuide). - INVOKABLE keyword documented in ref.txt and ace.txt. - List submodule README and API documentation. ------------------------------------------------------------------------------ v2.7.1 (2026-02-03) ------------------- New Features: - ELSEIF Keyword: Block IF statements now support ELSEIF for cleaner multi-branch conditionals. Syntax: IF condition THEN ... ELSEIF condition THEN ... ELSE ... END IF - LCASE$ Function (#33): New string function that returns the lowercase version of a string. Syntax: result$ = LCASE$(string$) Changes: - MUI Module Improvements: Added HorizSpacing/VertSpacing attributes and fixed boolean handling in MUI submodule. - MUI Constants Fix: Corrected MUI constants to match official mui.h header values. Bug Fixes: - Fix DATA Statement FFP Conversion (#40): Fixed regression where DATA statements with floating-point values were not correctly converted to FFP format. - Fix doublebuffer.h (#39): Corrected issues in the double buffering include file. Testing: - Refactored test-suite to use ASSERT (#38) for cleaner test verification. ------------------------------------------------------------------------------ v2.7 (2026-02-01) ----------------- New Features: - Closures and Function Pointers (#14): Support for first-class function references. Use @ operator to get a SUB address (@SubName), BIND to create closures with pre-bound arguments (BIND(@SubName, arg1, ...)), and INVOKE to call through a function pointer or closure (INVOKE ptr&(args)). BIND behaves a little bit like the Curry pattern in functional programming. See docs/ref.guide for more details. - Callback SUB (#28): New CALLBACK modifier for SUBs that can be invoked via the AmigaOS CallHookPtr() function. Syntax: SUB name(ADDRESS, ADDRESS, ADDRESS) CALLBACK Use @ to get the address for a Hook's h_Entry field (@MyCallback). - MUI Submodule (#23): MUI (Magic User Interface) support via the MUI.b submodule. Provides high-level BASIC wrappers for creating modern Amiga GUIs with windows, buttons, lists, menus, tabs, and more. Documentation: docs/MUI-Submod.guide. Includes 7 example programs, including a FileViewer example that uses a custom class. Note: This is a beta release - usable but more features will come. Report bugs or feature requests on GitHub. - Filled Circle/Ellipse (#15): CIRCLE command now supports trailing F flag for drawing filled circles and ellipses. Syntax: CIRCLE [STEP] (x,y),radius[,color[,start,end[,aspect[,F]]]] Fill uses AreaEllipse() and respects active PATTERN. - GADGET SETATTR Expressions (#20): GADGET SETATTR now accepts variables and expressions for tag values, not just constants. Enables dynamic gadget updates based on runtime values. - Graphics Double Buffering: New include file and example for double-buffered graphics programming. See examples/gfx/dbuf_demo.b. Changes: - 68020 Code Generation Default (#24): The compiler now generates 68020 native instructions by default. Use OPTION 2- in source to disable 68020 code generation for 68000 compatibility. - Module Command Uses vasm: The module compilation command now uses vasm assembler instead of the legacy assembler. - Enhanced bas script. It now accepts a list of submods for linking. And is overall a bit smarter. Bug Fixes: - Fix Library Closing (#25): Fixed issue with LIBRARY CLOSE not properly closing opened Amiga shared libraries. - Fix EXTERNAL Module Bugs (#29): Fixed bugs with uninitialized A4 register when using EXTERNAL modules, which caused crashes and incorrect behavior with shared variables and arrays. - Fixed Typos (#18, #26): Corrected various typos in source and documentation. Testing: - New test categories: closures, callback - Added SUB tests with SHARED variable access ------------------------------------------------------------------------------ v2.6 (2026-01-26) ----------------- New Features: - GadTools Gadget Integration: Full support for GadTools-based gadgets with modern Amiga look and feel. New syntax: GADGET id, status, label$, (x1,y1)-(x2,y2), kind [, TAG=value ...] - Gadget Kinds: Support for BUTTON, CHECKBOX, INTEGER, STRING, LISTVIEW, MX (mutual exclude), CYCLE, PALETTE, SCROLLER, SLIDER, TEXT, and NUMBER gadgets. - GADGET FONT: New syntax to set font for GadTools gadgets: GADGET FONT name$, size - GADGET SETATTR/GETATTR: Runtime modification and querying of gadget attributes via tags. - ASSERT statement: Runtime assertion checking for defensive programming. Syntax: ASSERT expression [, "message"] Prints "ASSERT FAILED: " and exits on failure; passes through silently when the condition is true. Implemented as an assembly-level runtime library function (assert.s in db.lib). - 68020 native code generation: When compiling with the -2 flag or OPTION 2+ in source, the compiler emits native 68020 instructions (muls.l, divs.l, divsl.l) for long multiply, divide, and modulo instead of calling library routines (lmul, ace_ldiv, ace_lrem). Emits "machine 68020" assembler directive for vasm. Documentation: - txt2guide.rb: Ruby script to auto-generate AmigaGuide documentation from text sources (ref.txt, ace.txt). Testing: - GadTools test suite: New 'gtgadgets' test category for GadTools gadgets. - Legacy gadgets tests: Separate 'legacygadgets' category for original BOOPSI gadgets. - Assert test suite: New 'assert' test category with ok and fail cases. - 68020 arithmetic test: opt020 test case validating native 68020 code generation for multiply, divide, and modulo operations. ------------------------------------------------------------------------------ v2.5 (2026-01-22) ----------------- New Features: - AGA Screen Support (modes 7-12): Full support for AGA chipset screens with up to 256 colors (8-bit depth). Toolchain Changes: - vasm/vlink replaces legacy assembler/linker: Uses vasm and vlink as the standard toolchain instead of a68k/blink. Bug Fixes: - FFP/vbcc floating-point compatibility fix: Fixed FFP handling in runtime library (sleep_for_secs and float routines) for vbcc compatibility. Build System: - GNU Makefile build system: New Makefile-ace and Makefile-lib in src/make/ replacing legacy AmigaDOS build scripts. - Rebuilt runtime libraries: Fresh db.lib and startup.lib compiled with the new toolchain. Project Housekeeping: - Directory restructured: prgs/ renamed to examples/, build scripts moved to src/make/, test infrastructure organized under verify/. - Test suite added: 35 test cases covering syntax, arithmetic, floats, and control flow, run via ARexx runner on emulated Amiga. - Documentation consolidated: Single README.md, .doc files renamed to .txt.