Skip to content

Release 2.0.0

Compare
Choose a tag to compare
@TollyH TollyH released this 24 Oct 18:37
· 403 commits to main since this release
07511cd

.NET 6, Self-contained (.NET install not required)

Additions:

  • Floating point support: There is now full support for performing operations on floating point numbers. This includes, but is not limited to:
    • Support for floating point literals (e.g. 2.0, -5.12, and .63) in source code.
    • Floating point math: standard addition, subtraction, multiplication and division - plus trigonometry, exponentiation and logarithms.
    • Instructions for converting between integers and floats with different forms of rounding: truncation, ceiling, floor, and nearest even.
    • Instructions for writing floating point values to the console and files.
    • Support for converting between floating point formats: float16 (half precision), float32 (single precision), and float64 (double precision). Keep in mind that only float64 (double precision) is supported for all other floating point operations in the language.
  • Signed support: There is now full support for performing operations on two's complement signed numbers. This includes, but is not limited to:
    • New sign and overflow status flags.
    • Support for signed literals (e.g. -5) in source code.
    • Signed math: addition, subtraction, and multiplication can be performed with the existing instructions. Signed division can be performed with the newly added instructions, along with negation.
    • Signed jump instructions: these use the values of the newly added status flags to jump based on signed comparison logic.
    • Sign extension: this allows conversion from smaller signed values (byte/word/dword) to full, 64-bit signed values.
    • Instructions for writing signed values to the console and files.
  • REPL environment: There is now a built-in REPL environment that allows you to enter instructions and have them execute and display their result in real-time. It can be accessed by using the repl operation in the command line.
  • AAP file format: The AAP file format has been updated to include a file header, providing information such as the version the file is compiled for, and features that the program in the file uses. Backwards compatibility with the old format is achieved with the --v1-format command line parameter.
  • Entry points: You can now specify the starting location for a program using the :ENTRY label. Programs will still start executing from the top if this label isn't specified.
  • There is now a new "byte swap" (EXTD_BSW) instruction to reverse byte order in a register, thereby converting between little and big endian.
  • Macro definitions now ignore most standard syntax rules, allowing them to be much more diverse in content.
  • The stack command in the debugger now takes an optional parameter to limit the number of values printed.
  • Programs will now have the version they were compiled for checked before they are executed, issuing a warning if they were built for a newer version.
  • The debugger now shows the signed and floating point value of registers where applicable.
  • The debugger now displays which status flags are set along with the full register printout.
  • Some errors related to file handling now output more easily understandable error messages.
  • The disassembler will now specify the address of invalid labels with a comment.

Fixes:

  • Writing base 10 numbers to files no longer causes raw bytes to be inserted first.
  • Using relative paths containing subdirectories as command line parameters now works as expected.
  • MUL will no longer set the carry flag when the multiplier is 0.
  • TST and CMP will no longer throw an error when used with the rpo register.
  • Strings with leading/trailing double quotes as a part of the string body no longer cause issues resulting from leftover code from the old parser.
  • RFC now checks that a file is open and has remaining characters before attempting to read.
  • A warning suggesting the use of HLT will no longer be issued if a file contains only data insertion directives.
  • Directives will no longer attempt to parse label literals as numeric values.

Example program changes:

  • Some examples have been altered to use the new features provided in this release.

Internal changes:

  • To facilitate the large number of new opcodes now required for floating point and signed support, the concept of extension sets has been implemented. Opcodes can now be either 1 or 3 bytes long, with 3 byte opcodes following this format: 0xFF, ExtensionSet, InstructionCode. Single byte opcodes will behave as they always did, corresponding to instruction codes in the base instruction set (0x00).
  • The call stack is now more efficient: only rpo and rsb are pushed when calling a function now, whereas rso would have also been unnecessarily pushed before. Backwards compatibility with the old calling convention is achieved with the --v1-call-stack command line parameter.
  • The header is now printed to stderr instead of stdout, preventing it from being included when piping the process output to another process or a file.
  • Unit tests have been included for every single opcode in the processor.
  • Enums are no longer contained within the Data class, now they are a direct part of the root AssEmbly namespace.
  • The parsedNumber out parameter for Assembler.ParseLiteral is now used in additional places.
  • A PowerShell script for building the reference manual documentation has been added.
  • BNF grammar definitions, along with representing graphs, have been added.
  • Program.cs has been completely refactored, deduplicating large sections of code.
  • The number of local variables in the Processor.Execute method has been reduced.
  • The implementation of the RNG instruction has been simplified.

Documentation Errors

  • The first code example in the "Address" subsection of the "Operand Types" section should use MVB, not MVQ.