diff options
Diffstat (limited to 'assembler/syntax.txt')
-rw-r--r-- | assembler/syntax.txt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/assembler/syntax.txt b/assembler/syntax.txt index 1eaf91c..399a44d 100644 --- a/assembler/syntax.txt +++ b/assembler/syntax.txt @@ -1,6 +1,6 @@ TODO: possibly simplify this to make it less of a pain to write -Leading and trailing whitespace is ignored +Leading and trailing spaces and tabs are ignored Comments start with ; and must not be inside "", '', or `` Comments must be preceeded by a space or tab if not at the start of the line @@ -20,7 +20,7 @@ Instruction queues are surrounded by { and }: add b, a, c } -{ and } must be on their own in the line (aside for whitespace and comments) +{ and } must be on their own in the line for a queue (aside for whitespace and comments) If a parameter (and just the parameter) is placed between [ and ], it will be considered an indirect reference; the memory pointed to by that will be used @@ -29,6 +29,7 @@ If an instruction is specified without { and }, it is considered to be an instru Labels are any combination of non-whitespace non-quotation from the start of the line to a ':', and not followed by any non-comment non-whitespace Labels must not be declared inside instruction queues If a label includes { or }, it must start with {, then a number, then }, to be used as its default size; all other uses of these characters are invalid + Otherwise, the default size will be the current mode Using the value of the label in a parameter will be '<name of label>:' as the operand, like so: add a, my_data:, b @@ -36,6 +37,8 @@ Using the value of the label in a parameter will be '<name of label>:' as the op Constants will have a default size of the minimum amount required to represent it in full, as will labels without a default size explicitly set +If a size is set and it does not fit within the parameter itself, the size will be rounded up to the nearest power of two + The "declare" keyword is to be used like an instruction, but not within an instruction queue It will place the following constant's or label's data into the binary output, for an unlimited number of parameters You may use "<data>" to place the literal value of its contents in the output; \ will only apply to " and itself when within these quotes |