[blog] | [projects] | [about] | [imprint]

ACE BASIC 3.0.1 - Variable Arrays and 68000 Compat

14 May 2026
 

ACE BASIC 3.0.1

A small follow-up to the 3.0 release. Two things worth talking about: variable-sized arrays, and the fact that the compiler itself now runs on a stock 68000.

Variable-Sized Arrays

Until now, DIM required a compile-time constant for the array size:

DIM nums&(100)

That works for fixed-size buffers, but it forces you to either pick a worst-case size or use ALLOC and manage the memory by hand. Version 3.0.1 lifts that restriction. DIM now accepts variables and expressions:

LONGINT n
INPUT "How many entries"; n

DIM nums&(n)

FOR i& = 0 TO n - 1
  nums&(i&) = i& * i&
NEXT i&

This also works for multi-dimensional arrays:

LONGINT rows, cols
rows = 8
cols = 12

DIM grid&(rows, cols)

Under the hood, constant-sized arrays still live in BSS as before. Variable-sized arrays are heap-allocated at runtime via ALLOC, with a small header storing the dimension sizes so multi-dimensional indexing keeps working. From the source-code side nothing changes -- you write DIM the way you always did, just with a variable instead of a literal.

68000 Compatibility

The other change is about hardware reach. Starting with version 2.7 the compiler was built for 68020 by default, which meant ACE itself needed at least an A1200 or an accelerator to run. With 3.0.1 the compiler is built for plain 68000 again, so it runs on any Amiga -- a stock A500 included.

The runtime libraries now ship in two variants:

  • lib/ -- 68020 builds (the default)
  • lib/68000/ -- 68000 builds (require vc.lib)

The bas script auxiliary tool looks at your source for OPTION 2- and picks the matching runtime automatically. If your program uses 68020 instructions (OPTION 2+, or the default), it links the 68020 libraries. If you opt out with OPTION 2-, it links the 68000 variants:

OPTION 2-

PRINT "This runs on a stock A500."

The same applies to the bundled tools: yap (the preprocessor) and parseusing are now compiled with OPTION 2-, and there is a 68000 build of vlink as well. So the whole toolchain -- compiler, preprocessor, linker, and runtime -- can be used on a 68000 machine.

If you only target 68020 and up, nothing changes for you. The default is still 68020 code generation, and the default runtime is the 68020 build. The 68000 path is opt-in via OPTION 2-.

Brief Mentions

  • YAP macro limit raised to 2048: the preprocessor now handles much larger sets of #define macros.
  • SuperOptimizer v2.28: updated, with a new SuperOptimizer guide in the documentation.
  • Bug fix -- math libraries always opened at startup: previously the compiler only opened mathieeesingbas and mathieeesingtrans when the main program referenced them. If an EXTERNAL module used floats or trig but the main program did not, the program would crash on the first math call. Both libraries are now opened unconditionally at startup.

Conclusion

A small release, but a useful one. Variable-sized arrays remove a long-standing limitation of DIM, and 68000 compatibility brings the compiler itself back to every Amiga out there. If you have a stock A500 sitting around, you can now use it to compile ACE programs.

The project lives on GitHub. Bug reports and feature requests are welcome.

[atom/rss feed]