From cd6982e5da1f5facdc1e0154b3a27c01e8b076c9 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 27 Jan 2021 13:42:57 -0500 Subject: - Fixed some bugs in the emulator. - Started work on implementing the Super VIA emulation. - Added support for disabling disassembly per instruction, when in debug mode. - Did some more work on rewriting the SuB Suite to work with the new calling convention. - Rewrote the symbol handling code in the emulator's assembler, to make it both simpler, and to add support for arbitrarily deep symbol scopes. - Added support for arbitrarily deep local symbol scopes. For example, to declare a symbol of depth 2, you add two '@' characters to the start of the symbol name. In other words, the number of '@' characters before the symbol name is what determines the scope of that symbol. And to use a symbol thats outside the current scope, you would use the same syntax as using a struct member, so you would do `global.local`. --- programs/sub-suite/subasm-syntax | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 programs/sub-suite/subasm-syntax (limited to 'programs/sub-suite/subasm-syntax') diff --git a/programs/sub-suite/subasm-syntax b/programs/sub-suite/subasm-syntax new file mode 100644 index 0000000..1337914 --- /dev/null +++ b/programs/sub-suite/subasm-syntax @@ -0,0 +1,56 @@ +/* Assembly language syntax for SuBAsm. */ + +/* Comments begin with "/*", and end with "*/". + * Directives begin with a `\`. + */ + +/* mnemonic is the instruction name/mnemonic. + * expr is an expression. + * Indirect Indexed means applying the index after the indirection. + * Indexed Indirect means applying the index before the indirection. + */ + +Expression syntax: + /* TODO */ +Instruction syntax: + Base ISA, and Base Extension: + Implied: + + B register: + b + Absolute/Zero Matrix: + /* [, ] means Indexed with x, or y. */ + [, ] + Immediate Data: + # + Absolute/Zero Matrix Indirect: + /* Indexing with x means Indexed Indirect. + * Indexing with y means Indirect Indexed. + */ + ([, x])[, y] + E Indirect: + (e) + Orthogonal Extension: + [, operand] + Operand syntax: + <\( + /* The operand starts with a register. + * If the statment is inside brackets, then + * it's a register indirect mode. + */ + [(]reg[+][\(+|-\)][)] + /* The operand starts with an expression. + * If the statment is inside brackets, then + * it's an indirect mode. + */ + |[(]expr + /* Is the operand using Indirect, or Indirect Indexed? */ + \if (ind || ind_indexed) { + [)] + \} + [\(+|-\)]>] + /* Is the operand using Indexed Indirect? */ + \if (indexed_ind) { + [)] + \} + \)> -- cgit v1.2.3-13-gbd6f