Skip to content
Textmode edited this page Mar 9, 2011 · 2 revisions

TMVM's default Assembler is FUASSM. FUASSM is a (relatively) simple flat assembler, but its sufficient for our current needs.

Instructions and Parameters

FUASSM instructions generally take the form INS parm, parm, parm. Each instruction has a different number of parms, which are generally required. Each Parm may be one of three types: Registers, Literals, and Symbols. Additionally each of these may be Absolute, or Indirect

  • Registers are the Menomic names of the TMVM registers, noted on the Specifications page, and will be encoded as references to those registers.
  • Literals are numerical or character literals. Numerical literals may be given in binary, hexadecimal, or octal. Numbers prefixed with '%' are considered to be binary. Numbers prefixed with '$', or suffixed with 'h', will be treated as Hexadecimal. Prefixing with the number '0' will mark a number as being octal. Character literals may be specified by wrapping the given character in single-quotes (though a known bug precludes this from working with all characters)
  • Symbols are named constants which may be used to give meaningful names to arbitrary numbers. Either directly (e.g. via the LET instruction) or indirectly (e.g. the LBL instruction)
    Generally, symbols may be used in place of literals in terms of their valid use in statements. Furthermore, they can generally be used before their definition, so long as they are defined in the same assembly unit (e.g. file)

A parameter is Absolute, by default. An absolute parameter stands for itself, '123' is the literal value 123. A parm can be made Indirect by prefixing it with '&', an indirect parameter stands for the address it represents; thus '&123' is the value stored in memory address 123.

Note: Support for the more traditional [parm] form for marking indirect parms is pending.

virtual Instructions and Psudoinstructions

In addition to those obviously on TMVM's opcode list, FUASSM supports the following instructions:

GTE R1,R2,RET Greater-than, or equal
(encoded as 'SWP, LES, SWP')
LTE R1,R2,RET Greater-than, or equal
(encoded as 'SWP, GTR, SWP')
LET sym,nn Build-time symbol decleration
Creates a symbol in the symbol table equal to *nn*. Symbols generally act like literals.
LBL sym,segsym Label statement
Creates the symbols sym and segsym, setting them to the current offset and segment.
BYTE sym,segsym,nn Data initialisation
Creates the symbols sym and segsym, setting them to the current offset and segment. additionally encodes *nn*. thus, this can be used to mark memory segments as stores, and set their initial values at build-time.

Clone this wiki locally