The parser have been rewritten which made some new features possible:
-
You can now use *=$1000 like in good old Turbo Assembler.
-
You can now use soft parenthesis. Kick Assembler will know by the context when it means an indirect adressing mode and when its a normal parenthesis.
-
A preprocessor have been implemented. You can now use the commands #define, #undefine, #if, #else, #elif and #endif (Those who know the C# preprocessor will be familiar with these).
-
There are also preprocessor commands for importing source: #import, #importif, #importonce. #import and #importonce works as the directives known from version 3.x. , but works better together with the preprocessor. #importif supports conditional imports as a simple oneliner.
-
The colon in front of macro and pseudocommand calls are now optional.
-
You can now add an optional ';' after directives and mnemonics. This is usefull if you are use to program languages like C++/Java or C# where these are required.
-
Kick Assembler now report multiple errors in the parsing phase instead of just the first.
-
Kick Assembler can now report syntax elements back to editors. (IN PROGRESS)
-
Kick Assembler can now report syntax errors back to editors, without starting to evaluate the code. (IN PROGRESS)
-
The new parser is faster. The Kick Assembler test suite now assembles in less than half of the time it took when using v3.40.
The scoping/namespace system has been upgraded:
-
Functions, Macros and PseudoCommands are now put in the current namespace when defined. (In 3.x only symbols where scoped)
-
Namespaces can now be reused (Several files can use the same namespace without getting a 'symbol already defined' error).
-
There is now a getNamespace() function that tells the current namespace.
-
Use '@' as prefix when defining a symbol/function/macro/pseudocommand to put it in the root-scope or root-namespace.
-
Use '@' as prefix when referencing a symbol/function/macro/pseudocommand to look it up in the root-scope or root-namespace.
-
NOTICE: There are currently no way of seeing functions/macros/pseudocommands from the outside of a namespace so place your public library functions in the root namespace.
-
Import now always imports to the root scope (Doesn't use the scope at the import call as parent scope)
-
Function/macro/pseudocommand calls now has the definition scope (where the function/macro/pseudocommand is defined) as parent scope during the call. This is consistent with most language like Java, C# etc.
-
All references to a symbol/function/macro/pseudocommand is now resolved in the prepass'. This means you will get errors for misspelled symbols at once. It also means that you can get errors from non-executed code.
-
Resolving symbols in the prepass' gives the same or slightly slower assemble times for performance light sources, but for heavy calculations it is much faster (Example: The fractal2 example from v3.x assembles 38% faster with Kick Assembler 4)
Other news are:
-
There is now a .while directive
-
There is now updated 'quick reference' appendix of options, preprocessor directives, directives and value types.
-
There is now an .encoding directive to switch between petscii/screencode encoding and uppercase/mixedcase.
-
Lines starting with # in KickAss.cfg are now ignored.
-
The source in the manual have been updated
-
The example suite has been rewritten (Its worth a look)
-
A converter to help convert from v3.x to 4.x is included in the distributed zip-file.