# Asar Changelog

## v1.91

Release: March 13, 2024

### Contributors:

- trillian
- orbea
- Atari2

### Changes:

- Fixed some deprecation warnings not showing up properly. (trillian)
- Fixed some compiler warnings, and added better versioning info to libasar on linux. This shouldn't matter to most end users. (orbea)
- Fixed some compiler warnings in MSVC. (Atari2)

## v1.90

Release: February 23, 2024

### Contributors:

- RPG Hacker
- trillian
- p4plus2
- Atari2
- Alcaro
- spooonsss

### Notes:

- The primary purpose of this release is to be a stepping stone towards Asar 2.0. For this purpose, a lot of features have been deprecated and will now throw warnings. Please fix any of those warnings you come across in your patches to assure they will still assemble in Asar 2.0.

### New features:

- The `error`, `warn` and `assert` commands now support the same functions as the `print` command. (RPG Hacker)
- Static labels (i.e. labels that don't move between passes) can now be used in more places, including if statements. (RPG Hacker)
- Asar can be built as a static library. (Atari2)
- Asar now uses named warnings and errors instead of magic numbers as identifiers. (p4plus2, RPG Hacker)
- Variadic macro parameters now use the syntax `<...[math]>`, which makes them less ambiguous and helps prevent syntax parsing bugs. (RPG Hacker)
- HiROM, ExHiROM, and ExLoROM mappers can now use `freecode`. (p4plus2)
- `check bankcross` now allows disabling checking for half-bank crossings (going from $7FFF to $8000). (p4plus2)
- New `pc()` and `realbase()` functions: returns the current SNES address that is being written to. (p4plus2, trillian)
- Namespaces can now be saved using `pushns` and `pullns`. (p4plus2)
- `while` loops can now be ended with `endwhile`. (p4plus2)
- It's now possible to use macro arguments and macro labels in files that are `incsrc`'d from macros. (trillian)
- Added `for` loops, used like `for i = 1..10`. These are more convenient than while loops in most cases and are the main replacement for `rep`. (trillian)
- `incbin` now has a new syntax for including a range of the target file which looks like the for loop range syntax and is less ambiguous. (trillian)
- Added `spcblock` feature as a replacement for `spc-inline`, which allows defining blocks of SPC data, but in a more flexible way that can easily be extended in the future. (p4plus2)
- Added the `--error-limit` option, which allows raising the limit on the number of errors that Asar will print before stopping. (trillian)
- `freespacebyte` command to set the byte value used for searching for freespace and expanding the ROM. (trillian)

### Bug fixes:

- Variadic arguments in macros can now also take zero arguments, which can be used to implement optional arguments. (RPG Hacker)
- Escaping quotes in macro calls now works more reliably. (RPG Hacker)
- Macro calls & definitions no longer break as easily from including whitespace. (RPG Hacker)
- For invalid table files, Asar now prints the line number of the first invalid entry. (RPG Hacker)
- Addr-to-line mappings now include `autoclean jml/jsl` commands, pseudo opcodes like `asl #4`, and most other data-writing commands like `db/dw/dl`. (spooonsss, RPG Hacker, trillian)
- `'''` and `';'` are now valid can now be used without causing errors. (trillian, RPG Hacker)
- Fixed some edge case bugs in Asar's virtual filesystem (usable via the DLL) on Windows. (Atari2)
- The `--version` commandline flag now causes asar to exit afterwards, which is the expected behavior for command-line flags. (Alcaro)
- Fixed some bugs with the label optimizer, making it optimize better. (p4plus2)
- Fixed freespaces sometimes being a few bytes too long. (trillian)
- Assigning labels with = now puts them in the right namespace. (p4plus2)
- Fixed some memory leaks and possible crashes in the DLL. (trillian)
- Fixed some phantom errors when using forward labels. (trillian)
- Asar should now allow as much recursion as system resources allow, and then throw a nice error instead of crashing. (Atari2.0, trillian, p4plus2)
- `optimize address` now works a bit more consistently (new behavior also properly documented in manual). (trillian)
- Fixed bug where pointing multiple autocleans at the same freespace would sometimes eat some of the data in it. (spooonsss)

### Deprecated features:

- Warning and error IDs: Use new name strings instead.
- xkas compatibility mode: port your patch to asar instead. Everything xkas compatibility mode does should already throw warnings.
- `JMP.l`: Use `JML` instead.
- Quoted symbolic arguments to functions (e.g. `sizeof("my_struct")`): Remove the quotes (`sizeof(my_struct)`).
- Redefining previously defined functions.
- `math round` and `math pri`: Use parentheses and explicit rounding where xkas-style math emulation is needed instead.
- `if !condition` to negate conditions: Use `if not(condition)` instead.
- While blocks ending with `endif`: Use `endwhile` instead.
- `check bankcross on`: Use `check bankcross full` or `check bankcross half` instead.
- `rep` to repeat commands: Use while loops, unrolled loops or for loops instead.
- Windows-specific paths (e.g. `incsrc dir\file.asm`): Use cross-platform paths instead (`incsrc dir/file.asm`).
- `table` command: Assign characters directly instead, like `'a' = $00`.
- `spc700-inline`: Use `spcblock` and `endspcblock` instead.
- `spc700-raw`: use `arch spc700` and `norom`.
- `fastrom`: Has never actually worked and can be removed.
- `header`: Doesn't do anything and can be removed.
- `#` before numbers in `db/dw/dl/dd` statements: this was intended for xkas compatibility but was for some reason enabled everywhere without a warning. The `#` does nothing and can be removed.
- Non-UTF-8 source files: Re-save your source files as UTF-8 in a text editor of choice.
- `;@command` and `@command` notation: Use `command` instead.
- Single-line/inline if statements: Use full if blocks with an `if`/`endif` pair instead. (Note that you can still have an if statement entirely on one line, you just need to have an `: endif` at the end of it.)
- `freespace fixed`: Use `freespace static` instead.
- `<math>` syntax for variadic macro parameters: Use `<...[math]>` instead.
- incbin with a range like `incbin file.bin:0-F`: use `incbin file.bin:$0..$10` instead. (note that the new syntax is end-exclusive.)
- `incbin file.bin -> target`: put an `org` or `freespace` command before the incbin.
- `if a = b`: use `if a == b` instead.
- Comments starting with `;[[` : These mark the start of block comments in Asar 2.0, so either remove the `[[` for the time being, or make the commented line end with a `]]`.
- Using `A` as a label name ambiguously, e.g. `lda a`: in Asar 2 this will be interpreted as trying to use the "A" addressing mode, and will give an error. You can use `A+0` if you really must refer to the label as is.
- The `startpos` command of the `spc700-inline` architecture: use the optional `execute` argument to `endspcblock` instead.
- Specifying the byte to use for freespace like `freecode $ff`. Use the new separate `freespacebyte` command for it.
- The `warnpc` command: use `assert pc() <= $xxxxxx` instead.

## v1.81

Release: January 20, 2021

### Contributors:

- p4plus2

### Bug fixes:

- Prevent defines from being resolved in false branches of if statements when inside variadic macros
- Fix a phantom error when referencing a struct before defining it

## v1.80

Release: January 18, 2021

### Contributors:

- RPG Hacker
- randomdude999
- p4plus2
- CypherSignal
- LDAsuku
- Katrina
- Atari2.0
- Vitor Vilela

### New features:

- The C DLL binding for Windows should now print a few more details if loading the DLL failed. (RPG Hacker)
- The `print` command has a new `bin()` function. Also, `bin()`, `dec()` and `hex()` now take an optional width argument that allows padding the number with zeroes. (randomdude999)
- Labels can now be used in the condition of an `assert` command. (randomdude999)
- The WLA symbol file now includes an address-to-line mapping, which can be used by some debuggers to provide source-level debugging. (CypherSignal)
- The `sizeof()` and `objectsize()` functions don't need quotes around the struct name anymore. For backwards compatibilty, quotes are still allowed. (p4plus2)
- There is a new label optimizer, which can convert RAM labels to direct page or word accesses where possible. For this there are 3 new commands: `dpbase`, `optimize dp` and `optimize address`. (p4plus2)
- The `floor()` and `ceil()` functions have been added. (randomdude999)
- The `bank()` and `<:` function and math operator have been added (p4plus2)
- The `datasize()` function has been added. (p4plus2)
- Warning if the mapper mode is changed after being set (p4plus2)
- Major improvements to internal string handling in asar (makes asar significantly faster) (p4plus2)
- Variadic macro support (p4plus2)
- Support for global labels (p4plus2)
- Errors about crossing banks have been improved, now they print the exact line where the bank border was crossed instead of saying it was "somewhere before this point". (randomdude999)
- Add `fill align` and `skip align` (randomdude999)

### Bug fixes:

- The Asar DLL can now be loaded in Windows applications that define UNICODE. (RPG Hacker)
- Labels can now start with underscores. (LDAsuku)
- An `undef` command inside an unexecuted `if` statement would still get executed. This is now fixed. (randomdude999)
- The `assert` command would give strange errors when the condition to test contained a comma. This is now fixed. (randomdude999)
- Trailing commas can now be used to join lines that contain more than one comma, and the joined lines can now have comments. (randomdude999)
- An invalid warning ID in a `warnings enable` command no longer prints the error message three times. (randomdude999)
- When using the Asar DLL, built-in defines (e.g. `!assembler_ver`) are now always present. Previously they were missing when the DLL was called without specifying a standard defines file. (randomdude999)
- Repeatable instructions (like `LSR #4` don't accept labels in their argument anymore. (randomdude999)
- Asar no longer writes an incorrect checksum for ROMs whose size isn't a power of 2, e.g. 2.5MB, 3MB, 6MB. (randomdude999)
- The "It would be wise to set the 008000 bit" warning has been relaxed and isn't thrown for labels in banks 70-7F. (randomdude999)
- Overwriting built-in functions now throws a warning. Overwriting user-defined functions now also throws a warning for consistency. (randomdude999)
- Opcode length specifications were sometimes being ignored in `arch spc700`. Now `adc.w a, $0` properly assembles to `85 00 00` instead of `84 00`. (randomdude999)
- Fixed case sensitivity problem in function calls. (p4plus2)
- Fixed struct definition with label base corrupting label name. (p4plus2)
- Fixed missing error on certain types of label. (p4plus2)
- Fix some phantom errors in math processor (randomdude999)
- Fixed a memory leak in the cli version of asar (p4plus2)
- Fixed a memory corruption in spc700 processing (p4plus2)
- Fixed various memory bugs (found via valgrind/fsanitize) (p4plus2)
- Fixed a case where if statements wouldn't always throw an error (randomdude999)
- Fixed a case where you could get invisible errors when prefixing commands with `@` (randomdude999)
- Fixed `arch superfx` ignoring all commands with more than 2 words (randomdude999)
- Fixed non-ASCII characters in strings being written as garbage (Katrina)
- Fixed crashes when getting into an infinite recursion loop (randomdude999)
- Improvements to syntax highlighting in the Asar manual (Atari2.0)
- The C# wrapper has been updated to work with Asar versions 1.60 and newer. (Vitor Vilela)
- Improved error message for SPC instructions with out of range arguments (randomdude999)

## v1.71

Release: January 6, 2019

### Contributors:

- randomdude999

### Bug fixes:

- The Super FX ROM mapping should now properly support freespace.
- The `canread()` functions returned true for the first byte after the end of the ROM. That has been fixed.
- Using `check bankcross off` now should mess with the PC less (i.e. no forced fastrom addressing).
- Using the `error` command now doesn't print the line of code that caused the error. All warnings except for the one from the `warn` command should now print the line of code that caused the warning. (note that not all warnings or errors are associated with a specific line of code.)

## v1.70

Release: January 4, 2019

### Contributors:

- randomdude999
- boldowa

### New features:

- The `fullsa1rom` mapper now supports automatic freespace searching. (randomdude999)
- `incbin` ranges can now use math as an alternative to unprefixed hex. To use this, surround the math with parentheses. For example, `incbin file:(4+2)-($F+$10)`. Note that in math statements, unprefixed numbers are decimal, not hex! (randomdude999)

### Bug fixes:

- Fixed quite a few crashes in Asar:
  - Fixed a crash when including a directory (randomdude999, found by Selicre)
  - Fixed a crash when using a macro sublabel outside of a macro (randomdude999)
  - Fixed a crash when having unmatched structs in a weird way (randomdude999)
  - Fixed a crash when appending to a non-existent define (randomdude999, found by Selicre)
  - Fixed a crash when Asar encountered mismatched quotes after define evaluation (randomdude999, found by Alcaro)
- Made Asar about 2x faster than before (randomdude999)
- Values larger than $80000000 in things like `dd` should work better (randomdude999)
- Fixed a freespace leak when using `prot` (randomdude999, found by WhiteYoshiEgg)
- Fixed Windows header includes, to make cross-compilation of Asar on Linux work better (boldowa)

## v1.61

Release: August 22, 2018

### Contributors:

- randomdude999

### Bug fixes:

- Fixed asar quietly skipping assembling a line if it had a label followed by 3 or more spaces and ended with `"`.
- In 1.60, `if !condition` was removed without a proper deprecation process. It has been re-added with a deprecation warning, because a few patches still managed to use it.

## v1.60

Release: July 6, 2018

### Contributors:

- RPG Hacker
- boldowa/6646
- zetaPRIME
- Horrowind
- randomdude999
- TheBiob
- BenJuan26
- Vitor Vilela
- KevinCathcart
- KungFuFurby

### New features:

- Asar is now officially hosted on GitHub: https://github.com/RPGHacker/asar
- Asar now uses CMake, which should make it easier to build on different platforms and with different compilers. (RPG Hacker, randomdude999, boldowa)
- Added a proper manual in HTML format to Asar, rather than just having the xkas manual and a TXT file with all changes. (RPG Hacker)
- Added Python binding for the Asar DLL. (randomdude999)
- Added `defined()` function (randomdude999) and `undef` command. (zetaPRIME)
- Added simple syntax highlighting for Sublime Text. (randomdude999)
- +/- label declarations can also end with an optional `:` now for consistency. (RPG Hacker)
- Added macro-local variations for +/- labels and sub labels, which are also prefixed with a `?`. (RPG Hacker)
- Added macro main label assignment. (RPG Hacker)

      macro my_macro()
      	?MacroLabel = $008000

      	dl ?MacroLabel	; Valid
      endmacro

      %my_macro()

      dl ?MacroLabel		; Error!

- Added support for a new type of label declaration: prefixing a label or sub label declaration (including macro labels) with `#` will create that label without modifying existing label hierarchies. This is mainly intended for hacky incsrc/routine macros as used by GPS, which can break existing label hierarchies when used. (RPG Hacker)

      macro my_new_routine()
      	jsl MyNewRoutine

      	!macro_routine_defined ?= 0

      	if !macro_routine_defined == 0
      		pushpc

      		freecode cleaned

      		#MyNewRoutine:
      			incsrc routines/mynewroutine.asm

      		pullpc

      		!macro_routine_defined = 1
      	endif
      endmacro

      Main:
      	%my_new_routine()
      .Sub

      	; Both of these are found
      	dl MyNewRoutine
      	dl Main_Sub

  Note that while it's technically possible to use this feature on sub labels, macro labels and macro sub labels, I don't think there's any reasonable use case for this. In most cases, regular macro labels and regular macro sub labels are recommended for usage inside macros.
- Added support for include search paths. (RPG Hacker)
- Added asar_patch_ex() function to DLL API, which works like asar_patch(), but takes additional parameters. (RPG Hacker)
- You can now escape `!` by doing `\!` (useful for preventing Asar to replace defines in certain places). (randomdude999)
- You can now escape `\` by doing `\\`. (RPG Hacker)
- Added support for `pushbase`/`pullbase`. (randomdude999, RPG Hacker)
- Added `check title` command which makes Asar verify the title of the output ROM (to assure a patch is applied to the correct ROM). (randomdude999)
- Added support for nested namespaces. (randomdude999, RPG Hacker)
  Enable them via the command:

      namespace nested on

- Added support for `check bankcross off` which disables checking for bank crossing. Use with caution; might not work with certain features or outright break some stuff. (randomdude999, RPG Hacker)
- Added a new, simple README. (randomdude999, RPG Hacker)
- Added a `filesize()` function and a `getfilestatus()` function. (randomdude999)
- Added support for `stdincludes.txt` and `stddefines.txt` - see manual for details. (RPG Hacker, randomdude999)
- Added support for setting defines via the command line or DLL API. See manual (section: usage) for details. (randomdude999)
- Added `includeonce` command for shared files which may be included multiple times, but should only be assembled once. (RPG Hacker)
- Added support for generating a symbols file. Currently, WLA and no$sns format are supported. (KevinCathcart)
- Opcode length specifiers (`.b`, `.w` and `.l`) are now also supported for the SPC700 architecture. (KungFuFurby)
- Added `stringsequal()` and `stringsequalnocase()` functions. (RPG Hacker)
- Added support for some built-in defines. Currently, `!assembler` and `!assembler_ver` are supported. Trying to modify those defines will throw an error. (RPG Hacker)
- Added IDs to all warnings and errors, together with functionality to enable or disable specific warnings. (RPG Hacker)
- Added a new optional warning that has to be enabled manually to throw warnings when opcodes are implicitly sized. (KevinCathcart)
- Added functionality to allow overriding Asar's default behavior of enabling/disabling checksum generation based on context. (randomdude999)

### Bug fixes:

- Fixed various bugs in the DLL interface. It should now hopefully be possible to apply multiple patches in succession via the DLL interface without resorting to hacks. (RPG Hacker, randomdude999, boldowa)
- Rewrote big parts of test applications once again to make it a lot easier to test a bunch of ASM files and actually get some meaningful information out of it. (RPG Hacker)
- Fixed the way `;@` works. This command was really meant for backwards-compatibility with xkas and is supposed to assemble everything following it, which it now does again. (RPG Hacker)
  As a result of this change, any of the following are now valid Asar code:

      ;@asar 1.60
      @asar 1.60
      asar 1.60

  When Asar finds an unknown command on a line starting with `;@` or `@`, it only throws a warning instead of an error. You can make use of this fact by using optional features from newer Asar versions and still have your patch assemble in old Asar versions, where those features are ignored (don't know how practicable and useful this really is, but in theory, it should be possible). And of course it can be used for patches that are compatible with both xkas and Asar, not that that's particularly useful anymore in this day and age.
- Changed format of existing command line arguments for consistency. (RPG Hacker)
- LoROM banks `$70` to `$7D` can be used correctly. (randomdude999)
- Struct definitions are cleared correctly in Asar lib. (randomdude999)
- Fixed a freeze that could occur when using `freedata align`. (TheBiob)
- Fixed a bug in `pad` command that made it not update the pc correctly and also made it trigger a bank cross error before actually writing any data into a new bank. (RPG Hacker)
- Fixed a rare crash when using the command-line interface in ways you're not supposed to use it. (randomdude999)
- Fixed `readfile()`/`canreadfile()` crashing when reading from more than 16 different files in the same patch. (randomdude999)
- Fixed the ROM title being reported incorrectly. (randomdude999)
- Fixed using really large values in math with `math round on` making the values negative sometimes. (randomdude999)
- Fixed an SA-1 mapping issue. (Vitor Vilela, randomdude999)
- Fixed `print double()` not working when any of their arguments contain commas or parentheses. (randomdude999)
- Made it possible to pass string parameters to functions like `readfile1()` via user-defined functions. Previously, this failed as Asar expected all parameters in user-defined functions to be numbers. (KevinCathcart)
- Fixed a bug related to evaluation of parameters in user-defined functions. In some situations, Asar returned the incorrect parameter. For example: given a user-defined function with a parameter `ab` and a paramater `abc`, Asar occasionally returned the parameter `abc` when referencing the paramter `ab`. (KevinCathcart)
- Added more undocumented features to the manual. (RPG Hacker)
- 0x hex literals were supported by Asar on some platforms, which wasn't supposed to be the case. Made sure 0x hex literals throw errors on all platforms. (randomdude999)

### Deprecated features:

- Started the process of deprecating xkas compatibility mode. From now on, using xkas compatibility features will throw warnings. In a future version of Asar, xkas compatibility will be removed entirely.
- Started deprecating `autoclear`, which is an alias of `autoclean`. Please use only `autoclean` from now on.
- Started deprecating `freespace fixed`, which is an alias of `freespace static`. Please use only `freespace static` from now on.
- Deprecated and removed support for `if !condition`. This feature was planned for deprecation as it bites with Asar's define syntax, but it was removed earlier than planned because, after inspecting the code, it was determined that it didn't work properly and probably wasn't even usable in versions prior to 1.60 at all. The only way to use it in Asar 1.60 was by using the new escape sequence for !, which didn't exist in earlier Asar versions. Thus it can be assumed that the feature wasn't used in previous Asar versions and can be removed safely. To negate conditions in Asar 1.60, either use the built-in logic functions (`if !(a == 0 && b == 0)` becomes `if not(and(equal(a, 0),equal(b, 0)))`) or directly negate the condition (`if !(a == 0 && b == 0)` becomes `if a != 0 || b != 0`).

## v1.50

Release: February 28, 2017

### Contributors:

- RPG Hacker
- p4plus2

### New features:

- Added support for structs.
- Added API to Asar lib for getting information on all blocks of data written by Asar.
- Added API to Asar lib for getting the mapper currently used by Asar.
- Added support for ExLoROM and ExHiROM mappers.
  NOTE: Based entirely on conversion tables I got from Ladida; don't know if these conversions are actually correct. Some features may not work as intended when using those mappers (such as `freedata`, for example), but I can't verify this.
- Added `pushtable` and `pulltable` commands, which let you back-up or restore the current character table to the/from the stack.
- Added `ext\notepad-plus-plus\syntax-highlighting.xml`. This file can be imported into Notepad++ as a user-defined language to add syntax highlighting for Asar patches, featuring all commands currently supported by Asar. By default, this syntax highlighting is enabled on all files with an extension of `.asm` or `.asr`, but this can be customized via Notepad++.

### Bug fixes:

- Lines starting with `@` or `;@` that don't map to a recognized special command now only throw warnings at best and no errors.
- Rewrote code of tests a little to make them easier to execute and make them clean up their own mess.
- C# wrapper for Asar DLL was non-functional since it didn't specify a calling convention, making it always lead to an exception in some scenarios.

### Notes:

- Just like the last version, this version of Asar was built in MSVC rather than g++, but this time I also updated the Asar DLL (which I had overlooked last time). I'm not sure if Windows applications are compatible with DLLs that were built by a different compiler, so if you're planning to use the DLL, this is something to watch out for. If you're planning to use a compiler other than MSVC, I recommend just rebuilding the DLL from source in whatever compiler you're using (or directly including the Asar library code in your project).

## v1.40

Release: October 23, 2016

### Contributors:

- RPG Hacker

### New features:

- `readfile` functions: `readfile1(filename, offset)`, `readfile2(filename, offset)`, `readfile3(filename, offset)`, `readfile4(filename, offset)` - similiar to `read1()` etc. functions, except data is read from another file instead of from the ROM (note that offset is a PC offset, not a SNES offset). You can pass an optional third value which is returned if the read fails. These functions are primarily intended for reading bytes from another file and then doing math with them. For example: reading bytes from a Lunar Magic .pal file, converting them into a different format and then writing them to the ROM as a table that can directly be DMA'd to CGRAM without further conversions (all conversions happen at compile-time). As an additional bonus, all of those functions cache any file passed to them (up to 16 simultanous files), which means that multiple readfile() calls on the same file will keep the file open rather than repeatedly opening and closing the file.
- `canreadfile` functions: `canreadfile1(filename, offset)`, `canreadfile2(filename, offset)`, `canreadfile3(filename, offset)`, `canreadfile4(filename, offset)`, `canreadfile(filename, offset, length)` - basically the `readfile()` equivalents of `canread1()` etc.
- `snestopc(address)` and `pctosnes(address)` functions: for manually converting addresses (note that those functions are dependent on the ROM's current mapping mode, so use them with caution - chances are you will never need them at all).
- `max(a, b)`, `min(a, b)` and `clamp(value, min, max)` functions: `max()`/`min()` return the maximum/minimum of two values, whereas `clamp()` makes sure that that value is `>= min` and `<= max.`
- `safediv(dividend, divisor, exception)` function: divides `dividend` by `divisor`, unless `divisor` is 0, in which case `exception` is returned.
- `select(statement, true, false)` function: if `statement` is 0, `false` is returned, in any other case, `true` is returned. Basically, a mathematical version of "if/else". Please note that unlike if/else blocks, function arguments in Asar are always evaluated before a function returns. In other words: if you do `select(1, 1/1, 1/0)`, Asar will throw a "division by zero" error, even though the function would return 1/1. In this particular case, it's recommended to simply use the `safediv()` function in place of a regular division.
- `not(value)` function: returns 1 if `value` is 0 and 0 in any other case.
- comparison functions: `equal(a, b)`, `notequal(a, b)`, `less(a, b)`, `lessequal(a, b)`, `greater(a, b)`, `greaterequal(a, b)` - rather self-explanatory, return 1 if the respective comparison is true and 0 otherwise. Primarily intended to be passed as statement to `select()` function.
- logical functions: `and(a, b)`, `or(a, b)`, `nand(a, b)`, `nor(a, b)`, `xor(a, b)` - also self-explanatory, return 1 if the respective logical operation is true and 0 otherwise. Primarily intended to be passed as statement to `select()` function.
- `while` loops: Added compile-time `while` loops to Asar. Those work similar to if conditionals, with the difference that their blocks are assembled repeatedly until their condition becomes false. For easier implementation and higher compatibility, while loops are terminated with `endif`, just like `if` conditionals. When using while loops, be careful not to cause an infinite loop. Asar won't make any effort to detect those.
- Multiline operator: You can now put `\` at the end of any line of source code and Asar will append the next line to it. This is similar to putting a `,` at the end of a line, with the difference, that the `\` itself does not appear in the concatenated string, whereas the `,` would. This is useful to split long function definitions into multiplie lines, for example. Note that all whitespace following the `\` is ignored, whereas whitespace preceeding the `\` isn't. Therefore

      db\
      $FF

  turns into

      db$FF

  for example, whereas

      db \
      $FF

  turns into

      db $FF

- `double(num)` print function: Can be passed to print to print a double variable with its fractional part. Has a default precision of 5 decimal places, but can be passed an optional second argument to override the precision.
- `round(num, precision)` function: Rounds the double variable `num` to `precision` decimal places. Pass 0 as precision to round to the nearest integer.

### Bug fixes:

- Asar 1.37 officially suppported overloaded versions of `read1()` to `read4()`, but always threw "Wrong number of parameters to function" errors when actually using those overloaded versions.
- Asar 1.37 threw "Wrong number of parameters to function" error for function `canread()` when passing 2 arguments to it, because it actually treated it as `canread1()` due to an internal error in string comparison.
- Using better double -> int conversions in some places - where

      dd $FFFFFFFF

  would assemble to `00 00 00 80` (`$80000000`) in Asar 1.37, it now assembles to `FF FF FF FF`
- Defines in `elseif` conditionals now get properly resolved.
- The `#=` define operator now doesn't truncate its value when using `math round off`, making it possible to do double-precision math with it.
- Asar 1.37 detected misplaced elses and endifs, but not misplaced elseifs.
- Putting `@xkas : @asar 1.37` on the first line would previously lead to an error, whereas putting `@asar 1.37 : @xkas` there would not. Both variations lead to an error message now, since it really doesn't make much sense to use them together in any combination.
- Special commands like `@asar` or `@include` could previously be used on the first line only and needed to be chained with a `:` inbetween. They can now be used on any line as long as no other command comes before or inbetween them.
- Asar 1.37 fixed a bug in SuperFX compilation, but `src/test/arch-superfx.asm` was never edited to acknowledge this fix, so the test always failed
- Added different define operators (`=`, `+=`, `:=`, `#=`, `?=`) to manual.txt. Those have been in Asar for quite a while, but were never documented yet, although they can be quite useful.

### Notes:

- This version of Asar was built in MSVC rather than g++, mainly because I already had that installed and use Visual Studo as an IDE, anyways. Functionally, this shouldn't make any difference, unless using Asar in unintended ways, where anything goes. I did build the Linux version in g++ to confirm compatibility, though.

## v1.37

Release: March 26, 2016

### Contributors:

- Raidenthequick

### New features:

- New `freespace` argument added; a `$xx` byte that will search the ROM for contiguous sections of that byte. Before it was hardcoded to only search for `$00`. Default is still `$00` if not supplied, so past patches should not be broken.
- In line with this, `autoclean` was hardcoded to clean using `$00`. This was fixed also to clean with the byte supplied by freecode, or `$00` if not supplied.

### Bug fixes:

- Super FX short addressing fixed, and added error checking for valid short address. For example, `lms r0,($00D4)` used to output `3D A0 D4`, which is actually incorrect because short addressing doubles the byte supplied by the instruction to give a range from `$0000`-`$01FE` with just one byte (since Super FX reads words). This now outputs `3D A0 6A` which is correct. Also, asar now throws an error for anything outside `$0000`-`$01FE` as well as all odd-numbered addresses for both `sms` and `lms` instructions. (Odd-numbered addresses cannot be accessed using short addressing due to the multiplying by 2.)
- Super FX and SPC700 labels were broken if used within freespace. This has been fixed by doing what 65816 does: mask the address with `0xFFFFFF` because freespace addresses use a high byte to indicate that they're freespace.
- Fixed SA-1 mapping using wrong Super MMC banks range.

## Version information below here was added retroactively and may be incorrect and/or incomplete.

[+] Expand

## v1.36

Release: November 28, 2013

### Contributors:

- Alcaro

### New features:

- Added the fullsa1rom mapper.
- Asar now halts if more than 20 errors are detected.

### Bug fixes:

- Fixed a warning about $xx,y not existing if $xxxx,y doesn't exist either
- Fixed sublabels requiring a parent label even in xkas compatibility mode
- Fixed a memory leak in the DLL

## v1.35

Release: December 13, 2012

### Contributors:

- Alcaro

### New features:

- Made freecode print the size of the requested freespace if allocation fails.

### Bug fixes:

- Fixed a crash caused by incbin'ing a file and specifying an endpoint beyond the end of the file.
- Blocked readN on exactly one byte after the end of the input ROM.

### Deprecated features:

- fastrom has been removed. It gives far too many problems relative to its advantages (are there any?). In exchange, freespace searching in lorom is now always fastrom enabled. (The command itself still exists, but it does nothing.

## v?.??

Release: November 11, 2012

### Contributors:

- Alcaro

### New features:

- Added -DTIMELIMIT support on Windows. Note that it's more limited than on Linux; it seems to only check the time limit every seven seconds, it can't print error messages, and it bugs up on anything above 429 seconds. (But you shouldn't need to set it above one or two anyways.)

### Bug fixes:

- Missing an org/freespace command now no longer places the first byte at SNES $FFFFFF, but jumps to $008000 directly.
- Allowed JMP.l in xkas mode...
- Fixed PC->SNES conversion for 0x380000 and higher.
- Fixed BEQ a.
- fastrom : org $8000 : db $01 : warnpc $8001 no longer throws errors.
- Made bit shifting unsigned, to match how xkas behaves.
- Made db $0-10 return -10, not -16.
- Including a file that enables xkas mode, while xkas mode is already enabled, no longer throws errors.
- Fixed dd $FFFFFFFF acting like dd $7FFFFFFF.
- Fixed compile errors on GCC 4.7.
- Made blockreleasedebug and blockdebugrelease not show up anymore.
- Files saying @asar can no longer be included from files saying ;@xkas.
- Locked org $F00000.

## v1.33b

Release: October 26, 2012

### Contributors:

- Alcaro

### Bug fixes:

- Rearranged the manual a little to have a more obvious filename.
- Nuked a debug code that kept printing nonsense.

### Notes

- Asar now considers OS X a non-Linux Unix-line and recommends -Dlinux.

## v1.33

Release: October 22, 2012

### Contributors:

- Alcaro

### New features:

- Made incbin file.bin -> $123456 possible. This one can go as far as you want; it doesn't mind crossing banks nor exceeding the size of a RATS tag. It does, however, demand to know the SNES position in advance; you can't use labels here. (It also refuses to go outside the ROM)
- Added a sandbox mode that disables everything that loads external files. Only accessible by recompiling (-DSANDBOX) since it should only be useful for people who have compilers already.
- Added a way to make the process abort if it runs too long. Linux+recompile (-DTIMELIMIT=60) only.

### Bug fixes:

- Nuked some spurious warnings in incsrc/incbin if the base path contains backslashes.
- Made Asar a little more eager to detect bank crossings. Now those errors appear in the correct file.
- Made REP #$FFFF throw errors instead of repeating 65535 times.
- Fixed a bunch of weird code in the freespace finders.
- Made sure . does not count as a label.
- Fixed LDA Label,y in emulation mode. Asar tried using 24-bit addressing for that, but there is no such addressing mode.
- Another accuracy improvement in emulation mode.
- Detonated some more SPC700 inaccuracies and bugs.
- Made JMP ($1234)+($3412) assemble to JMP abs, not JMP (abs).

## v1.32

Release: October 8, 2012

### Contributors:

- Alcaro

### New features:

- Added @xkas, which will revert to maximum xkas compatibility mode and change the behaviour of a couple of commands (as well as throwing warnings on various Asar-only commands).
- Any line starting with ;@ will now be assembled. This is intended to be combined with the above one to create ;@xkas, which will send Asar into xkas mode while letting xkas ignore it, but you can also use ;@if 0 : org !Freespace : ;@endif : ;@freecode (except with the colons replaced with linebreaks).
- Replaced bank off with bank auto, and added bank noassume, which always uses long addressing if possible.
- Removed the @ trick for suppressing warnings. Its only legit use was telling Asar that a freespace is cleaned in a way it can't understand. freecode cleaned is the new way to say that.
- Whitespace, blank lines and comments are now allowed to exist before @asar, ;@xkas and @include/@includefrom.
- Added !define ?= value, which sets !define to value if !define is previously undefined.

### Bug fixes:

- Blocked \ in incsrc/bin because linux.
- Reworked prot a bit. You can now use multiple prot statements in the same freespace; Asar has always allowed cleaning them out anyways. The old implementation was rather hacky.
- Fixed build scripts a little. Some files didn't get included.
- Fixed the internal ROM size when expanding SA-1 ROMs.
- Killed some dead code.
- Made db 0x80 assemble properly with math round on (the default).
- Killed a phantom error on ALS A and a couple of similar constructions.
- Squished a possible moving labels error.
- Fixed a bug where the major version of Asar got compared backwards in @asar.

## v1.31

Release: September 13, 2012

### Contributors:

- Alcaro

### New features:

- Added incbin file.bin -> Labelname support.
- Added align detail to freespace/freecode/freedata.
- Made reset freespaceuse a valid operation.
- Added arch spc700.

### Bug fixes:

- Killed some more Linux compile errors.

### Deprecated features:

- Deprecated arch spc700-raw.

## v1.30

Release: August 24, 2012

### Contributors:

- Alcaro

### New features:

- Added SuperFX mapper and arch superfx.
- Unlocked $[F0-FF]:[8000-FFFF] in lorom again. Turns out bsnes only maps SRAM to the lower halves of those banks.
- Added an elseif command.
- Added && and || support to if/etc conditionals.
- Reworked the Relative branch out of bounds errors a little, so it tells how far outside the bounds they are.
- Added print dec($1234) and print hex(1234).
- Attached test suite in the source zip, in case some other programmers are interested.
- Added @include and @includefrom, which throws errors if Asar is invoked directly on them.
- Added a -pause=<action> flag on the command line. Valid actions are "yes", "warn", "err", and "no" (default).
- Added a couple of synonyms to the single-bit SPC700 opcodes.
- Added underscore-prefixed versions of all builtin functions.
- Added error-safe readN and canreadN.

### Bug fixes:

- Reworded the 125 freespaces limit to make sure nobody can think there's a limit of 250 labels.
- Made readN()ing and writing to the same byte in ROM well defined (it gives the same value as it had in the input ROM).
- Made the size guesser a little smarter. It now assumes .b for LDA #$123456/65536.
- Killed a phantom error on the very rare code pattern db $80/(Label2-Label1) : Label1: : db 0 : Label2: and similar.
- Adjusted the error messages read1/etc gives if the address is invalid.
- Suppressed a couple of useless errors if labels are redefined.
- Killed a couple of Invalid endif errors if an if statement is invalid.
- Repaired nested pushpc/freedata.

## v1.29

Release: July 19, 2012

### Contributors:

- Alcaro

### New features:

- Added -v and -version switches.
- Removed the lock on $700000-$7DFFFF in HiROM as it's not mapped to SRAM there.
- Edited the library API a bit.

### Bug fixes:

- Added an error message for mov (x)+,a in the SPC700 modes.
- Nuked a bug making tabs not treated as spaces in all contexts.
- Fixed a bug where Label = 123 checked that there is an org in front.
- Fixed a bug where the line number was removed if the last code block on a line crossed a bank border.

## v1.28

Release: ?

### Contributors:

- Alcaro

### New features:

- Flipped the switch to autocorrect the checksum to on by default.

### Bug fixes:

- Nuked some double spaces in outputs.
- Fixed sa1rom mapping breaking on everything except the first megabyte.
- Fixed a couple of bugs with valid table files being rejected.

## v1.27

Release: ?

### Contributors:

- Alcaro

### New features:

- Made freespace fixed a synonym of freespace static.
- Made Asar try to autodetect whether the ROM is LoROM or HiROM. Homebrews default to LoROM.

### Bug fixes:

- Zapped a phantom error if the code arch spc700-raw : org $010000 : db $00 is used.
- Nuked some pointless errors with static freespaces.
- Zapped a bunch of bugs with static/fixed freespace.
- Killed a bug that crashed Asar if a line contained both commas and unmatched quotes.
- Replaced the Press Enter to continue with the standard Press any key to continue prompt on Windows.
- Refactored some parts of the math parser, to get rid of some possible escaping NaNs.
- Added some #errors if no frontend is chosen, and edited some others a bit.
- Adjusted Linux support a bit. Looks like it bitrotted.
- Fixed some off-by-one errors in spc700-inline.

## v1.26

Release: April 28, 2012 or earlier

### Contributors:

- Alcaro

### New features:

- Added support for db +1. There's no reason not to allow it.

### Bug fixes:

- Removed some more files made useless by dropping asar-clr.dll.
- Fixed a bug where db $12,$34 broke in the spc700 modes.
- Fixed a bug where an invisible bank border was hit if a base command was used without an org command.

## v1.25

Release: ?

### Contributors:

- Alcaro

### New features:

- Rewrote the .NET library as a C# wrapper around asar.dll using P/Invokes, for better Linux compatibility (Mono really seems to hate C++/CLI). This also means that asar-clr.dll no longer exists.
- Made errors not shred the ROM in the library frontend.

### Bug fixes:

- Killed a bunch of moving label errors if a PROT is misplaced. No point throwing 300 errors for one misplaced line.
- Fixed error messages erroneously being printed to stdout instead of stderr.
- Fixed errors with prot being incompatible with fastrom.
- Fixed an uninitialized variable.
- Fixed a buffer underflow Valgrind whined about.
- Zapped a null pointer bug in the library if a file was not found.
- Nuked a bug where the library did not clear out previous errors when applying a new patch.

## v1.24

Release: ?

### Contributors:

- Alcaro

### New features:

- Added SA-1 support. Syntax is sa1rom 0,1,2,3, where the four numbers are the bank numbers, 0 through 7. It's allowed to not give them; that will result in 0,1,2,3 being picked as default.
- Added freespace finding support for hirom and sa1rom.
- Made Asar remove extranous quotes around filenames if a file is pulled to the Asar window.
- Minor adjustment to the ROM title verifier.

### Bug fixes:

- Fixed a phantom error if prot isn't used directly after a free* statement.
- Fixed a bogus error if prot is placed at any of the first eight bytes of a bank.
- Repaired autoclean, which appears to have broken a few versions ago.
- Fixed a crash bug if the ROM does not exist and couldn't be created.

## v1.23

Release: ?

### Contributors:

- Alcaro

### Bug fixes:

- Fixed around ten broken SPC700 opcodes.

## v1.22

Release: ?

### Contributors:

- Alcaro

### New features:

- Added a few special cases for some functions, and adjusted some compiler flags. The result is dramatically improved performance.
- Adjusted the string table a bit.

### Bug fixes:

- Fixed an uninitialized value in the macro handling code that may (but usually doesn't) throw errors if a macro has no arguments.
- Repaired partial incbin if the filename is quoted.

## v1.21

Release: ?

### Contributors:

- Alcaro

### Bug fixes:

- Fixed: read1() etc. went missing.

## v1.20b (?)

Release: March 4, 2012

### Contributors:

- Alcaro

### Bug fixes:

- Added freecode static and norom to changes.txt.

## v1.20 (?)

Release: March 4, 2012

### Contributors:

- Alcaro

### New features:

- freecode/freedata have been expanded: They now take an optional parameter containing comma separated parameters on how to hand out the freespace. Valid parameters are ram, noram, and static. ram tells Asar that this code needs the RAM mirrors and puts the code in banks 10-3F; noram tells Asar that the code (or table) does not need the RAM mirrors, and therefore uses banks 40-6F if possible; static demands that the freespace does not move; if it grows, Asar throws an error. freespace has also been added; freecode is a shortcut to freespace ram.
- Added hirom support. It works just like in xkas: hirom : org $C00000 : JML Main. Also added norom, where the PC address is the same as the SNES address (not counting SMC headers); use this (and base) if you want to implement your own mapper (preferably in a macro).
- Simplified table code, and made it accept assigning stuff to the = character.
- LDY #Label>>16 (and LDA/LDX/etc) is now considered 8bit. This should reduce the need for explicit .b hints.
- Asar can now use the last byte of the ROM as freespace.
- Made the default value for untouched table bytes be more random to make errors in usage more obvious.
- Lowered the recursion limit a bit.
- You can now drop the extensions on both filenames, if you want to.
- Asar now tries to no longer parse defines inside if 0 blocks. Note that this doesn't help on single-line if statements; you'll need a multiline if.
- Added !def := val, which expands everything inside the value before setting it (making !a := a!a a perfectly safe operation).
- Added !def #= val, which expands the value into an integer and stores it into the define. !a #= 1+1 : L!a: is a valid operation.

### Bug fixes:

- Fixed fastrom again again again.
- Labels before the first org/freecode/etc are now considered to be at $008000, not $FFFFFFFF. (They're still considered invalid.)
- Some minor fixes in autoclean dl Label.
- Repaired the ** operator.
- Calling a function no longer hits a user-defined function starting with the name of called function.
- Fixed skip command, which previously only edited the base address.

## v1.14 (?)

Release: February 8, 2012

### Contributors:

- Alcaro

### Bug fixes:

- Killed a crash bug.

## v1.13 (?)

Release: February 7, 2012 (?)

### Contributors:

- Alcaro

### New features:

- Added a random icon, to fit the Nordic theme of Asar's name.
- Made asar_patch destroy the ROM if any errors are encountered, to ensure that nobody attempts to use a ROM that may contain subtle breakage.
- A label can now be on the same line as a macro call.

### Bug fixes:

- Fixed the bug that makes macros look like they're called from themselves if the macro call is broken.

## v1.12 (?)

Release: February 6, 2012 or earlier

### Contributors:

- Alcaro

### Bug fixes:

- Fixed fastrom mode again...
- Fixed crashes when closing Asar while waiting for input.
- Macro definitions are now ignored inside if 0 blocks.
- Macros and incsrc may now be called inside if 1 blocks.
- Locked banks $F0-$FF from usage. They are not usable.

### Deprecated features:

- Removed most of the emulation mode. The only remaining change is that it makes Asar print the errors to stdout instead of stderr, since that quirk isn't fixable by editing the ASM files.

## v1.11 (?)

Release: January 25, 2012 or earlier

### Contributors:

- Alcaro

### New features:

- Prefixing a command with @ will now make Asar not print warnings for that line.

### Bug fixes:

- JMP and JSR within the current bank with bank active has been fixed.
- xkas appears to allow sublabels starting with numbers. Asar has been updated to do the same.
- fastrom no longer messes up branches.
- autoclean read3($123456) can now be used before the first org.
- db ($04<<2)|($80>>1) no longer breaks due to unmatched parentheses.
- Fixed problem with autoclean $123456, where it read a pointer from $123456 instead of removing $123456.
- Fixed a crash if a freespace block protects itself.

## v1.10 (?)

Release: January 13, 2012

### Contributors:

- Alcaro

### New features:

- Made asardll.h and asardll.cpp work if compiled as both C and C++, and renamed asardll.cpp to asardll.c, for greater compatibility with other languages (hi, Objective-C). As an effect of this, the library name argument has disappeared from asar_init.
- base off is now a valid operation. It tosses the base address back to the current code insertion location.
- New command: bank. It makes the label optimizer act as if it's in another bank. This is not the same as base; LDA Label,x : Label: db $01,$02,$03,$04 will use 24-bit addressing for the LDA if bank is active. It's intended for long codes that assume the data bank register is not the same as the code bank register.
- Added a copy of GPLv3 to asar.zip, since LGPL is apparently meaningless on its own. These licenses are starting to get a little tricky.

### Bug fixes:

- Reworded the documentation for prot.
- Asar now throws a warning if a freespace block appears to be leaked.
- Adjusted "autoclean at the end of a RATS tag" error a bit.
- Made Asar not read uninitialized/garbage memory if there's crappy content at the end of a macro.
- Fixed infinite loop if a freespace of size 32768 is requested.

## v1.09 (?)

Release: January 6, 2012

### Contributors:

- Alcaro

### New features:

- New command: warn.
- The math parser now accepts strings like 0.5 if you turn off rounding. It'll break if rounding is on, since that wouldn't make any sense. It'll round down as soon as it's returned from the math parser; db 0.9 is the same as db 0, but db 0.4*0.4 is the same as db 1.
- assert can now take another parameter. If this is given, it is printed in the error message. (All error-generating blocks are printed, which makes these messages appear twice)
- Asar now attempts to check if the ROM title looks sane before applying a patch.
- Added Linux/OSX support to asardll.cpp.
- Added asar_math() to the library frontend.
- Now prints a message if patching is successful. However, calling it from the command line makes it remain silent, unless you add -verbose.

### Bug fixes:

- Restored documentation of the functions to changes.txt that were forgotten when removing stdlib.asm.
- Fixed crashes if a macro is called with wrong number of arguments.
- Fixed silent errors when using LDA Label,y if Label is in another bank.

## v1.08 (?)

Release: December 27, 2011

### Contributors:

- Alcaro

### New features:

- Added special meaning to the define !assembler: Its value is always "asar", even if you assign something else to it. Intended usage: !assembler = xkas : %freespace_!assembler(), where %freespace_xkas() requires the user to set freespace and %freespace_asar() contains a freecode.

### Bug fixes:

- Restored db 1+'a' support to the math parser.
- Merged the dupe descriptions for the fastrom command in the documentation.
- Fixed sublabel support, which the new math engine broke as well.

## v1.07 (?)

Release: December 25, 2011

### Contributors:

- Alcaro

### New features:

- Replaced the math library with a more powerful one.
- New command: math.
- Homemade functions can now safely replace builtin ones, to compensate for the possibility that new builtin functions may collide with ones in your codes.
- Added a few new functions: log, log10, and log2.

### Bug fixes:

- Removed #ifdef ALCAROBOT (sandbox mode) from a few source files.
- Fixed a few more memory leaks.

## v1.06 (?)

Release: December 25, 2011

### Contributors:

- Alcaro

### Bug fixes:

- Sprite Tool compatibility was still broken. Looks like tmpasm.bin is unheadered after all. Repaired again.

## v1.05 (?)

Release: ?

### Contributors:

- Alcaro

### New features:

- Updated libsmw and libstr to the latest versions from AlcaRobot.

### Bug fixes:

- Asar no longer crashes if it tries to open a file of less than 512 bytes if it thinks it's headered. This fixes Sprite Tool compatibility.

## v1.04 (?)

Release: ?

### Contributors:

- Alcaro

### Bug fixes:

- $xxFFFF can now safely be overwritten.
- Removed garbage from some errors.

## v1.03 (?)

Release: ?

### Contributors:

- Alcaro

### New features:

- Renamed the DLL frontend to LIB, since DLLs only exist on Windows and dynamic libraries exist elsewhere too. No point using more Windows terminology than needed.
- Various edits to the library frontends. asar_i_* has been renamed to asar_*, and errors and warnings now tell where they're called from, if found inside a macro.
- The command line frontend tells where problematic macros are called from.
- Made license choice explicit.

## v1.02 (?)

Release: ?

### Contributors:

- Alcaro

### New features:

- Made it possible to call asar_i_patch() multiple times without calling asar_reset() between them. The errors will remain until you asar_reset() is used, meaning they'll accumulate until they are cleared.

### Bug fixes:

- Fixed a crash bug in asar_i_reset() if the function does not create any custom functions.

## v1.01 (?)

Release: ?

### Contributors:

- Alcaro

### Bug fixes:

- Put a few lines back where they should be, to get rid of a crash.

## v1.00 (?)

Release: December 2, 2011

### Contributors:

- Alcaro

### New features:

- If an error occurs, it now prints the buggy block, if relevant.
- Various changes to the DLL API.
- Crappily cobbled together a hack to make Asar compatible with Sprite Tool (a file called tmpasm.bin is now considered to be headered).
- Included the script used to compile the .NET DLL.

### Bug fixes:

- Fixed a memory allocation mismatch.

### Deprecated features:

- Dropped autocolon, since it's useless and never used.
- The set command has been removed.
- stdlib.asm has lost its special meaning.

## v?.??

Release: November 29, 2011

### Contributors:

- Alcaro

### New features:

- asar-cli.dll has been renamed to asar-clr.dll, and its contents has been moved to namespace AsarCLR instead of asarcli. This will require your tools to be edited, but it shouldn't take longer than a minute or two.
- Added a function to the DLLs to view the table data.
- New setting: werror. It makes warnings emit errors if encountered.

### Bug fixes:

- pushpc no longer throws idiotic errors everywhere.
- asar-clr.dll can now return errors/warnings/etc without crashes.
- Killed off a bunch of memory leaks in asar-clr.dll.
- STA $12,y warnings now print only once.
- asar_resolvedefines no longer throws exceptions outside the DLL.
- Squashed a memory leak bug where the math module allocates some memory without freeing it when the DLL is unloaded.

### Deprecated features:

- Removed AsarCLR::Asar::unmanageerrors() from asar-clr.dll. It's an internally used function that shouldn't be exported.

## v?.??

Release: November 21, 2011

### Contributors:

- Alcaro

### Bug fixes:

- Fixed a bug that made + and - labels not be treated as labels under some circumstances.
- Made "relative branch out of bounds" errors disappear again unless they're supposed to exist.

## v?.??

Release: November 20, 2011

### New features:

- if 0 now blocks label creation.
- asar-cli.dll now exports a set of functions using .NET types instead of C types.
- The DLL APIs have been slightly changed with regards to initialization and stdlib.asm.
- Asar now prints warnings and errors to stderr instead of stdout. (Emulation mode is unaffected.)

### Bug fixes:

- Repaired "branch out of bounds" errors.

## v?.??

Release: November 17, 2011

### Contributors:

- Alcaro

### Bug fixes:

- Removed more debug code
- Fixed org Label if the label is in freespace

## v?.??

Release: November 17, 2011

### Contributors:

- Alcaro

### New features:

- You can now use if !condition to negate the statement. Note that you may need an extra set of parentheses due to conflicts with define syntax.
- Parentheses can now be used inside macro arguments. (Just make sure to close them.)
- Included a .NET version of asar.dll. Note that it still uses unmanaged types.
- Asar now accepts org Label if the label is defined prior to use. (It's still not allowed to jump to a label that's defined later in the patch.)

### Bug fixes:

- If a relative branch is out of bounds, Asar no longer throws "labels keep moving around" errors.
- Removed the strange size hex value warnings.

## v?.??

Release: November 14, 2011

### Contributors:

- Alcaro

### Bug fixes:

- The autoclean warning for the end of a freespace area has been fixed. Again.
- The freespace finder no longer skips a RATS tag if it's preceeded by an unprotected 00.

## v?.??

Release: ?

### Contributors:

- Alcaro

### Bug fixes:

- autoclean no longer complains if it attempts to overwrite something that isn't a valid SNES pointer.

## v?.??

Release: November 13, 2011

### Contributors:

- Alcaro

### New features:

- if statements have been made much more powerful. The old action if the statement is false was skipping the rest of the line if the statement is false; the new action is skipping the rest of the line, or if the if statement is at the end of the line, it skips everything until an endif. Nested if statements are allowed, as are else statements. (Note that you can't use else on one-line if statements.)
- New command: prot. If used directly after a freecode or freedata command (that is, at the start of the RATS tag), it may contain a list of labels (up to 80 or something). The freespace blocks pointed to by these labels are removed if the freespace area is cleared by an autoclean. Example: org $008000 : autoclean JSL Main : freecode : prot Mydata : Main: LDA Mydata : RTL : freedata : Mydata: db $12,$34,$56,$78
- Labels may be defined as Main(), not just Main:. This has been noted in the documentation.
- Asar can now be built as a DLL file, but it's not tested very throughly.
- 'x' = $1234 is now a valid operation. It's equivalent to table file, but it accepts math and it's one file less to keep track of.
- db 'x'+4 is now a valid operation.
- freecode and freedata can now expand the ROM if needed.
- !a = abc : !{a}def is now valid operation; it's equivalent to abcdef. You can nest defines inside the !{}s; a!{b!{c!def}g}h is accepted (assuming all defines exist).

### Bug fixes:

- autoclean now works if called from $008000.
- autoclean now works if aiming for the last eight bytes of a RATS tag.
- autoclean now refuses to protect anything that isn't a label, for example math or constants, unless using the two-parameter method.
- autoclean now refuses to protect a label at the end of a freespace block, since it'll think the RATS tag after that is the one that should be removed.
- db 1/Label : Label: is now accepted, instead of being treated as a division by zero.
- ($12),x is an error in xkas, since that addressing mode doesn't exist. However, Asar accepts parentheses and treats it as LDA $12,x, which isn't what the user meant. Therefore, it now emits a warning if this happens.

### Deprecated features:

- !a equ $1234 is no longer valid.

## v?.??

Release: November 7, 2011

### Contributors:

- Alcaro

### New features:

- set fastrom is now documented in stdlib.asm.
- Minor edits to the documentation.
- An xkas emulation mode was added, which makes Asar act more like xkas 0.06. It should hopefully be 100% compatible with all previously submitted patches/sprites/etc.
- Asar can now fix the checksum.
- The command line options have been edited a bit, including a few bugfixes.

### Bug fixes:

- Opcodes that may or may not take an argument (INC, LSR, etc) now work better together with autocolon.
- "Unknown command" errors have been edited.

### Deprecated features:

- set resizable has been removed.

## v?.??

Release: October 25, 2011

### Contributors:

- Alcaro

### New features:

- labelopt is no longer off
- A lone { or } is now treated as a null command (for use with code folding). Note that they're not allowed elsewhere. They don't need to be matched.

### Bug fixes:

- autoclean no longer kills inappropriate data if pointed to an unused area. Operator precendence screwed up stuff.

## v?.??

Release: ?

### Contributors:

- Alcaro

### Bug fixes:

- Asar will no longer place rats tags at any part of the unexpanded area, not even if it's a long list of 00s
- Fixed a bunch of odd bugs with the automatic size finder and label optimizer, including one that treated LDA.l Label,x as LDA.w Label,x

## v?.??

Release: October 23, 2011

### Contributors:

- Alcaro

### New features:

- Blank lines are now allowed in macros.

### Bug fixes:

- Broken or unknown macro arguments no longer abort assembling the rest of the macro.

### Deprecated features:

- Removed the command DIEDIEDIE, a useless command that intentionally froze Asar if it's called from $088000 or later.

## v?.??

Release: October 23, 2011

### Contributors:

- Alcaro

### Bug fixes:

- Fixed relative forward branches in freespace too.

## v?.??

Release: October 23, 2011

### Contributors:

- Alcaro

### New features:

- How quickly Asar aborts if it finds errors can be set
- autocolon now accepts db $20, $30
- autoclean JSL.l is now valid

### Bug fixes:

- Fixed some uninitialized value errors that created garbage error messages if the patch doesn't exist
- Putting a label in front of an opcode messed up earlier; this has been fixed
- freecode forgot setting a few variables, which creates a bunch of errors if it's used

## v?.??

Release: October 18, 2011

### Contributors:

- Alcaro

### Bug fixes:

- Added a missing else statement on the label optimizer disabling flag that made it turn it on, or get values that change in crappy ways, for everything.

## v?.??

Release: October 18, 2011

### Contributors:

- Alcaro

### New features:

- Asar can now assemble SPC700 code, though very little testing was done on this and a lot of bugs may still be included. Also note that mov a,(x)+ has been moved to mov a,(x+), since that opcode increases X and not the value X points to. Two lines in arch-spc700.cpp can be uncommented to reenable the first syntax.
- The fastrom command has been moved to set fastrom on.
- Readded the base command.
- Other small changes.

### Bug fixes:

- The first line of stdlib is no longer ignored (a variable wasn't initialized).
- Assembling is aborted if errors are detected, instead of continuing. As a side effect from this, errors are no longer printed twice or thrice.

### Deprecated features:

- rep Label has been blocked. It was never supposed to be allowed.

## v"0.30 or 0.40 or something"

Release: October 11, 2011

### Contributors:

- Alcaro

### New features:

- LDA $9E,y is now treated as LDA $009E,y, but it prints a warning.
- New command: set. It can set various options, including expected ROM title (the romtitle command has been removed), if the .l->.w optimizer should be active, and if warnings should be shown.
- Asar can now automatically (try to) add colons where it thinks they should be. Note that this is disabled by default and not recommended for anything serious.
- As with the colon adder, it should be avoided unless there is a good reason to use it (for example running it from an IRC bot). (Note that a time limit should be enabled when running it from an IRC bot so that noone can freeze the bot with slow patches).

### Bug fixes:

- Unknown command errors have been made saner. The old method was some sort of debug code.
- Carriage returns are now ignored on Linux.
- Assembling blank patches on nonexistent ROMs or ROMs with length zero has been fixed.

## v?.??

Release: October 9, 2011

### Contributors:

- Alcaro

### New features:

- !a += +1 has been implemented.

### Bug fixes:

- If you type "freespace", the tool gives a more detailed error message that "Unknown command."
- A bug related to using pushpc inside a freespace has been fixed.

### Notes

- The tool has been renamed to Asar. Pronounciation: The first A is short, and the second is long (as in "Bazaar", except without the B). It doesn't matter if the S is pronounced as S or Z.

## v?.??

Release: October 8, 2011

### Contributors:

- Alcaro

### New features:

- It now looks for and assembles stdlib.asm. However, it prints an error if it doesn't find it.
- Expected ROM title can now be set, see stdlib.asm for details. It defaults to SUPER MARIOWORLD if omitted, and it may not be set outside of stdlib.asm.
- A 64-bit version has been included.
- Both autoclean and autoclear works now. They act identically.

## v?.?? (Initial Release)

Release: October 6, 2011

### Contributors:

- Alcaro

### New features:

- Parentheses can be used, which allows some previously impossible statements.
- Defines can be made longer without risk for crashes. This makes it much easier to implement Hijack Everywhere.
- An if statement has been included, to get rid of the need for including those rep -1 tricks.
- Freespace can be set automatically (it even includes a simple way to reclaim freespace used by older versions of the patch)

### Notes

- In this original release, the tool was named "a.as"