Going from Version 3.x to 4.0

1. The new features

The parser have been rewritten which made some new features possible:

  1. You can now use *=$1000 like in good old Turbo Assembler.

  2. 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.

  3. 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).

  4. 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.

  5. The colon in front of macro and pseudocommand calls are now optional.

  6. 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.

  7. Kick Assembler now report multiple errors in the parsing phase instead of just the first.

  8. Kick Assembler can now report syntax elements back to editors. (IN PROGRESS)

  9. Kick Assembler can now report syntax errors back to editors, without starting to evaluate the code. (IN PROGRESS)

  10. 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:

  1. Functions, Macros and PseudoCommands are now put in the current namespace when defined. (In 3.x only symbols where scoped)

  2. Namespaces can now be reused (Several files can use the same namespace without getting a 'symbol already defined' error).

  3. There is now a getNamespace() function that tells the current namespace.

  4. Use '@' as prefix when defining a symbol/function/macro/pseudocommand to put it in the root-scope or root-namespace.

  5. Use '@' as prefix when referencing a symbol/function/macro/pseudocommand to look it up in the root-scope or root-namespace.

  6. 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.

  7. Import now always imports to the root scope (Doesn't use the scope at the import call as parent scope)

  8. 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.

  9. 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.

  10. 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:

  1. There is now a .while directive

  2. There is now updated 'quick reference' appendix of options, preprocessor directives, directives and value types.

  3. There is now an .encoding directive to switch between petscii/screencode encoding and uppercase/mixedcase.

  4. Lines starting with # in KickAss.cfg are now ignored.

  5. The source in the manual have been updated

  6. The example suite has been rewritten (Its worth a look)

  7. A converter to help convert from v3.x to 4.x is included in the distributed zip-file.