d/kmm32-as:add examples and clarify and fmt

This commit is contained in:
Kitty-Cricket Piapiac 2023-03-31 21:13:16 -07:00
parent 4a2f26ac46
commit 07a7728b01
1 changed files with 9 additions and 6 deletions

View File

@ -15,30 +15,33 @@ SYNTAX
{ - Comment; all text until the next `} is ignored.
" - String literal; this is included in the resultant binary literally.
EG: "meow" puts "meow" in the output binary
EG. "meow" puts "meow" in the output binary
# - Hexadecimal literal; the amount of bytes included in the output binary
is either 1, 2, or 4 based on length. Numbers are little-endian.
EG: #00 outputs a byte, #0000 a half word, and #00000000 a full word
EG. #00 outputs a byte, #0000 a half word, and #00000000 a full word
: - Label definition
@ - 32-bit reference to label
EG. `pw @label ju` would jump to the label defined by :label
^ - 8-bit relative reference to label
EG. `pr ^label ju` would jump to the label defined by :label
! - Macro definition; words that follow are included in macro until `;
EG: !meow #0000 ;
` - Macro reference;
EG. `meow will now output 2 bytes of 0s
EG. `meow (from above) will now output 2 bytes of 0s
- - Assembler built-in; these can take some amount of arguments.
~ - Switch data and return stacks on the instruction which takes up the rest
of the token.
Otherwise, it is treated as an instruction. (See d/kmm32 for ISA documentation)
Instructions can additionally have the following prefixes, which may affect the
resulting opcode:
Otherwise, it is treated as an instruction.
~ - F flag (flip stack manipulations from data <-> return stacks)
BUILTINS
Colour of arguments denoted with first character.