Skip to content

Release 3.0

Choose a tag to compare

@informedcitizenry informedcitizenry released this 22 Apr 12:16
· 78 commits to master since this release
86d8210

Release 3.0

Features

Directives

  • The pseudo-op .bankbytes extracts the bank byte values of expressions in the list
  • The pseudo-ops .hibytes and .lobytes extract upper and lower byte values of expressions in the list
  • The pseudo-ops .hiwords and .lowords extract upper and lower word values of expressions in the list
  • The directives .ifconst, .ifnconst and their corresponding .else directives allow for conditional assembly based on the constness of the expression
  • The scoping directive .import allows to use symbols defined in a separate scope without referring to them by their fully qualified name.

Command-Line Options

  • The command-line option -E completes source preprocessing and exits after outputting to the output stream
  • The command-line option --no-highlighting suppresses highlighting of causes of errors and warnings
  • The command-line option --Wall enables all other warning options
  • The command-line option --Wambiguous-zp warns when an argument could be zero-page or absolute
  • The command-line option --Wjump-bug warns whenever the indirect JMP bug is encountered when in 6502 mode
  • The command-line option --Wtext-in-non-text-pseudo-ops warns whenever string data is used in non-string pseudo-ops
  • The command-line option --Wsimplify-call-return warns whenever a subroutine call and subsequent return can be simplified to a jump
  • The command-line option --Wunreferenced-symbols issues a warning for every symbol that is defined but never referenced

Data types and operations

  • More robust type checking in expression evaluation
  • Multiline strings
  • Multidimensional and associative arrays (dictionaries)
  • Range operations on array and string sequences
  • String concatenation with the + operator
  • The arithmetic right shift operator >>> and its complement assignment >>>= shift an integer to the right while preserving its sign
  • The identity equality operators === and !== test if two identifiers refer to the same object
  • Pre- and post-fix increment operations (++ and --) for numeric variables
  • Support for floating point hexadecimal exponential notation, and for floating point non-decimal literals generally
  • A \ followed by a line feed/carriage escapes the newline character
  • The discard _ variable is available for operations where the result of an expression is not needed

Built-in symbols

  • The sizeof function returns the size (in bytes) of the argument. This is distinct from the existing len function that merely reports the length of the string or array expression
  • The int and float functions convert the number argument into an integer or float, respectively
  • The constant MATH_TAU represents τ, which is the count of radians in a turn (2*π)
  • The typeof function returns the expression type in the argument

Changes

Labels

  • Label setting in condition blocks will result in errors if they are set in multiple condition blocks, since symbols now are created in compile time rather than runtime, while conditions evaluate only at runtime. Refer to documentation for further details
  • As a result of the change described above, the use of the .label directive is unnecessary for .goto statements to the label that occur past the label's definition

Data types

  • Type enforcement and safety in expressions, e.g. mathematical operators only work for mathematical operands, compare for boolean, etc.)
  • Some directives require constant expressions for their operands, but those expressions can be prefix or infix
  • Custom user functions now support multiple return types, including complex types like arrays and dictionaries
  • String characters can be accessed by index

Diagnostics

  • Warnings and errors in included files will also report the inclusion source file and line where the .include directive has bene invoked
  • Similarly, warnings and errors in expanded macros will report the macro invocation source file and line
  • The short name of --errors to output errors to the text file in the specified path is now -e, since -E is repurposed for preprocessed output.

Parsing

  • 6502.Net now leverages ANTLR, an open source parser generator. This change allows more advanced features and expression types to be incorporated into the application

Other changes

  • Mnemonics and register names are now considered reserved words for the current target CPU only at runtime, and are available as symbols otherwise. See documentation for full details
  • The \ in a string can only follow a valid escape character.
  • The .let directive now accepts multiple assignment expressions
  • Colons will no longer be recognized as statement delimiters when occurring in semi-colon comments; this makes the command-line option --ignore-colons deprecated
  • The .cpu, .end, .macro/.endmacro and .include/.binclude preprocessor directives are always case insensitive, and are not affected by the -C option
  • The argument f/full of the command-line option --createconfig will enumerate the entire options, whether or not the were specified, instead of generating a sample
  • The .break (or similar control directive) is now strictly optional in switch .case statements, and fallthroughs will not be reported to the user.

Fixes

  • Certain macro expansions stopped working correctly after a recent update. This has been fixed
  • Fixed a bug where assembly status would report too few bytes if assembly reached the end of the 64KiB address space
  • The poke() function was not behaving according to its documentation for addresses outside the bounds of the generated code