as: XGATE-Syntax
1
1 9.53.2 Syntax
1 -------------
1
1 In XGATE RISC syntax, the instruction name comes first and it may be
1 followed by up to three operands. Operands are separated by commas
1 (','). 'as' will complain if too many operands are specified for a
1 given instruction. The same will happen if you specified too few
1 operands.
1
1 nop
1 ldl #23
1 CMP R1, R2
1
1 The presence of a ';' character or a '!' character anywhere on a line
1 indicates the start of a comment that extends to the end of that line.
1
1 A '*' or a '#' character at the start of a line also introduces a
1 line comment, but these characters do not work elsewhere on the line.
1 If the first character of the line is a '#' then as well as starting a
11 comment, the line could also be logical line number directive (⇒
Comments) or a preprocessor control command (⇒Preprocessing).
1
1 The XGATE assembler does not currently support a line separator
1 character.
1
1 The following addressing modes are understood for XGATE:
1 "Inherent"
1 ''
1
1 "Immediate 3 Bit Wide"
1 '#NUMBER'
1
1 "Immediate 4 Bit Wide"
1 '#NUMBER'
1
1 "Immediate 8 Bit Wide"
1 '#NUMBER'
1
1 "Monadic Addressing"
1 'REG'
1
1 "Dyadic Addressing"
1 'REG, REG'
1
1 "Triadic Addressing"
1 'REG, REG, REG'
1
1 "Relative Addressing 9 Bit Wide"
1 '*SYMBOL'
1
1 "Relative Addressing 10 Bit Wide"
1 '*SYMBOL'
1
1 "Index Register plus Immediate Offset"
1 'REG, (REG, #NUMBER)'
1
1 "Index Register plus Register Offset"
1 'REG, REG, REG'
1
1 "Index Register plus Register Offset with Post-increment"
1 'REG, REG, REG+'
1
1 "Index Register plus Register Offset with Pre-decrement"
1 'REG, REG, -REG'
1
1 The register can be either 'R0', 'R1', 'R2', 'R3', 'R4', 'R5', 'R6'
1 or 'R7'.
1
1 Convene macro opcodes to deal with 16-bit values have been added.
1
1 "Immediate 16 Bit Wide"
1 '#NUMBER', or '*SYMBOL'
1
1 For example:
1
1 ldw R1, #1024
1 ldw R3, timer
1 ldw R1, (R1, #0)
1 COM R1
1 stw R2, (R1, #0)
1