Repository navigation
Releases
Releases · waitingforvsync/baron
v0.6.0
Breaking changes
- 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_CANJUMPandZA_RETURNTOmust 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_AUTOvariable whose address is used (LDA #var,EQUB var,PRINT var) but which no instruction touches is now an error. - A local in a
FUNCTIONbody can only be read once something has assigned it (a forward reference used to read the previous pass's value).FUNCTIONparameters and locals no longer appear in the--symbolsdump. FOR,NEXT,REPLACEandWHEREare new keywords (see New features below), so locals orFUNCTIONs with those names will need renaming.- An
IFin aFUNCTIONbody given a list or a string is now an error. It used to run neither branch, silently.
New features
- Section transforms:
transform = "name"on aSECTIONpasses its bytes through aFUNCTIONof yours as it closes - to compress, encrypt or checksum them - and everything after it settles to the new size. WithBITLEN,BITPACKandLZ_PARSE(the cheapest LZ parse under cost tables you describe, with repeat matches and offset reuse), a compressor is a page of Baron.examples/compresshas four, each with its 6502 decompressor: a simple LZ, Exolite, ZX02, and Exomizer's own format. FUNCTIONbodies can reassign locals and loop withFOR ... 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-wiseIF.FINDtakes an optional third argument, returned instead of an error when nothing is found.SUMjoins a list of strings, andMIN,MAXandSORTwork 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.
FUNCTIONcalls are much cheaper in time and memory, and recursion can go 128 calls deep (was 64).--warn 3reports branches that cross a page boundary (an extra cycle when taken).- Faster list handling: arithmetic over lists of numbers,
FINDwith many needles, andCONCAT.
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_INDEXEDBYaccepts an access whose base sits below the variable, as inLDA v-4,Xwith 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_AUTOalias no longer emits the wrong address. ZA_POOLgiven aZA_AUTOvariable 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.
v0.5.3
Added TO_STRING() and TO_NUMBER() functions.
v0.5.2
- Splice Baron assembly into a BASIC line with a trailing open brace, and a close brace immediately followed by the rest of the line. See the Guide for more details.
- Bug fixes caught by fuzzer.
Baron 0.5.2 builds against a slightly updated version of richc so you will have to update submodules when building.
v0.5.1
What's Changed
- Name code, not a data label, in the unreachable ZA_AUTO warning by @mattgodbolt in #20
- Resolve ZA_CANJUMP/ZA_CANCALL/ZA_RETURNTO targets by label across sections by @mattgodbolt in #21
v0.5.0
Breaking changes
- Changed the symbol dump format (
--symbols) to categorise by symbol type (label, assignment, za auto), and arranged into section-major format.
New features
- Added concept of virtual sections which emit no bytes, and can be reopened. Good for defining labels sequentially from a pool, for example, in parallel with the code.
Bug fixes
- Fixed
FUNCTIONsymbol scope clashes across files (thanks @mattgodbolt) - Handle non-converging passes better to avoid long run times
- Fixed range parsing so that
0..2..2is valid
v0.4.2
Fixed some zp allocator bugs that were pessimising allocations and issuing errors on certain recursive code shapes.
v0.4.1
- Added
ASSERTkeyword (both as a statement and a function expression) - Improved error emission inside
FUNCTIONs - Various crash bugfixes found by fuzzing
v0.4.0
ZA_INDEXEDBY values: declare the index values the register can hold at the indexedZA_AUTOaccess just before it (var,X/var,Y/(var,X)). The access is then bounds-checked against the variable's width and assembles in silence; ranges and lists flatten likeEQUBdata.- The unchecked-indexed-access warning is now shown by default (it was opt-in): silent assembly requires the
ZA_INDEXEDBYdeclaration. ZA_WIPE: Placed directly after a zero-page wipe loop, it promises every pool byte has been freshly written: values may rely on the wipe for their zeroes, every earlier live range ends there, and the sweep's own stores are not warned about.- New opt-in warning: a store whose literal address or indexed base lies inside the
ZA_POOLwithout naming aZA_AUTO(the one stray pointer that is statically visible). --warn <n>: choose the warning level (default 1; 2 adds the opt-in checks; 0 errors only).--symbols <file>: dump every source file's resolved symbols to a JSON file - full dotted paths, sorted keys, one symbol per line, diffable.-vv, and a reshaped-vlisting: labels list with their address (1900 .install_irq), assignments show the value they became with the source expression bracketed (base = 18 [&12]), the byte field is wider, and-vvdumps every emitted byte and whole list values.--pad: pad a.ssdimage out to a full 80-track disc (200K).- Relaxed reserved names: labels,
FORvariables, macro andFUNCTIONparameters,ZA_AUTOnames and-Ddefines may share a spelling with any keyword, mnemonic or macro. Assignments can use reserved names with the@prefix:@next = 5bindsnext. OnlyTRUE,FALSEandPIstay reserved outright. ZA_DISCARD/ZA_WIPEplacement is now path-accurate: a marker belongs to the path it is written on, with a label as the pivot - above the label it stays on the arm that falls in, below it it covers every arriving path.- A missing
INCLUDEfile is reported immediately as a fatal error, instead of surfacing as misleading parse errors downstream. - Fixed:
ZA_AUTOvariables reached with,Yindexing (which has no zero-page encoding, so the access widens to absolute) were invisible to the allocator's analysis - a table read only that way could be classified unused or have its bytes reused while still live. - Fixed:
FORover a list literal could bind garbage to later iterations when the loop body's expressions were allocation-heavy. - Fixed: a string value with an embedded NUL byte cut the
-vlisting short. Unprintable bytes in a string now render as.in listings and diagnostics; the assembled bytes are untouched. - Numbers up to 32 bits now print exactly in listings and
PRINT(&FFFF1900no longer renders as4.29484e+09). - Both zero-page allocation documents substantially reworked and expanded.
v0.3.0
Breaking changes
Redesigned sections.
- Nested sections now propagate emitted bytes from child to parent. That means you can create a section containing changes of
orgby defining child sections inside it. The parent section gets all of the child sections' data. - Attributes are no longer inherited from parent to child.
- Removed
INCSECTION; the relocation workflow can now be done by nesting (see The Baron Guide)
v0.2.2
Fixed a bogus "Assembly does not settle" error caused by PRINTs in dead IF blocks.