You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A virtual section opened inside a real section now needs its own org. It used to take the enclosing addresses, overlapping whatever came after it.
ZA_CANCALL, ZA_CANJUMP and ZA_RETURNTO must name your own code by its label: a plain address that lands on assembled code is now an error. In return, labels resolve to the right section, in lists and with offsets (label + 3) too.
A ZA_AUTO variable whose address is used (LDA #var, EQUB var, PRINT var) but which no instruction touches is now an error.
A local in a FUNCTION body can only be read once something has assigned it (a forward reference used to read the previous pass's value). FUNCTION parameters and locals no longer appear in the --symbols dump.
FOR, NEXT, REPLACE and WHERE are new keywords (see New features below), so locals or FUNCTIONs with those names will need renaming.
An IF in a FUNCTION body given a list or a string is now an error. It used to run neither branch, silently.
New features
Section transforms: transform = "name" on a SECTION passes its bytes through a FUNCTION of yours as it closes - to compress, encrypt or checksum them - and everything after it settles to the new size. With BITLEN, BITPACK and LZ_PARSE (the cheapest LZ parse under cost tables you describe, with repeat matches and offset reuse), a compressor is a page of Baron. examples/compress has four, each with its 6502 decompressor: a simple LZ, Exolite, ZX02, and Exomizer's own format.
FUNCTION bodies can reassign locals and loop with FOR ... NEXT. Loops have no depth limit, and free each step's working memory as they go. (#28, thanks @tornewuff)
REPLACE(x, old, new) replaces text in strings and runs of elements in lists. WHERE(mask, a, b) is the element-wise IF. FIND takes an optional third argument, returned instead of an error when nothing is found.
SUM joins a list of strings, and MIN, MAX and SORT work on strings. (#25, thanks @tornewuff)
The guide now explains how strings, lists and broadcasting fit together.
Sections now own their bytes (#17). Any top-level section can be reopened (a reopening takes no attributes), a top-level section takes no room in the code outside sections, and a real section inside a virtual one keeps its bytes and can be saved.
FUNCTION calls are much cheaper in time and memory, and recursion can go 128 calls deep (was 64).
--warn 3 reports branches that cross a page boundary (an extra cycle when taken).
Faster list handling: arithmetic over lists of numbers, FIND with many needles, and CONCAT.
Bug fixes
ZA_ annotations in one section no longer apply to an instruction in another section at the same address (#29).
A list of annotation targets resolves its labels across sections again (#30, thanks @mattgodbolt).
A list referring forward to a label now settles (#31, thanks @mattgodbolt).
ZA_INDEXEDBY accepts an access whose base sits below the variable, as in LDA v-4,X with X from 4 to 7 (#32, thanks @mattgodbolt).
A branch into labelled inline data no longer runs on into the code after it, which gave a false recursion error (#34).
A forward reference to a ZA_AUTO alias no longer emits the wrong address.
ZA_POOL given a ZA_AUTO variable is now an error (it used to reserve &00).
Very large numbers, infinity and NaN are refused with an error rather than causing undefined behaviour, and ranges with huge endpoints no longer overflow or hang. Found by fuzzing.