For a complete reference of ColdFire opcodes and addressing modes consult ColdFire Family Programmer's Reference Manual (CFRM).
Assembler supports instruction set architecture A, B, and C. Use program options to select desired ISA.
Registers recognized by assembler:
For a complete list of supported addressing modes refer to CFRM. Here possible alternative forms and changes to the syntax described in CFRM are listed.
Alternative syntax is supported where displacement is given outside the parentheses: disp(An).
Scale is given by a number 1, 2, or 4. If omitted scale of 1 is used.
Alternative syntax is supported where displacement is given outside the parentheses: disp(An, Xi*Scale).
Note: Size of indexing register cannot be specified and is assumed to be long.
Alternative syntax: disp(PC).
Scale is given by a number 1, 2, or 4. If omitted scale of 1 is used.
Alternative syntax: disp(PC, Xi*Scale).
Note: Size of indexing register cannot be specified and is assumed to be long.
Assembler interprets integer numbers only in one of the following systems: decimal, hexadecimal, and binary. Decimal numbers consists of combination of digits 0 to 9. Hexadecimal numbers must start with dollar sign '$' followed by hexadecimal digits. Binary numbers start with '@' sign followed by 0s or 1s. All numbers must be less than 2^32.
Character enclosed in single prime symbols, e.g. 'x', evaluates to a number with ASCII value of an enclosed character; that is it is not a string.
Strings form a type distinct form numbers. String literals are constructed by enclosing characters in quote marks '"' (double prime symbol). No special string combinations are supported, so "\n" for instance is not a new line character, but two separate characters.
Strings can be passed to macro definitions or used in DC.B directive. Note that character enclosed in prime symbols, such as 'A', is a number, not a string.
Example:
message DC.B "Message", 10, 0 ; 10 is a new line char in_quotes DC.B '"', "Message", '"', 10, 0
Label identifiers may consist of letters, digits, underscore characters, and leading dot or question mark. They cannot start with a digit. Note that directive names and instruction mnemonics are reserved and cannot be used as labels.
Labels are declared by placing them in the first position in line. Labels have global range unless they start with dot '.'. Labels starting with '.' have local scope. Each global label declaration opens new local scope.
To assign particular value to a label follow it by an equal '=' sign and expression.
Example:
MAX = 1000 .loop SUBQ.L #1, d0 BEQ .loop RTS text: dc.b "Hello World", 0
Register lists are formed by specifying '/' separated data and/or address registers. Ranges of registers can be formed too using minus sign '-'. Register list is expected by MOVEM instruction, but it can also be assigned to a label or passed to a macro.
Example:
list = D2-D5/A2/A5 MOVEM.L D3/A3, (SP)
Assembler supports arithmetical and logical operators. They are listed below ordered by priority, with highest priority operators at the top.
Grouping expressions. Square brackets are used to avoid confusion with parentheses which form different addressing modes. Use them to change order of calculations.
Unary operators: - arithmetical negation, ! logical not, ~ bitwise not, < low word, > high word.
Multiplication, division, and modulo operations, respectively.
Arithmetical bit shift left and right.
Addition and subtraction.
Bitwise and, or, exclusive or, respectively.
Comparison operators.
Boolean and.
Boolean or.
Numbers can be combined using operators to form expressions. All instructions expecting numbers also accept expressions evaluating to numbers.
Function BITCOUNT returns number of bits set in 'expr'.
Function DEF returns 1 (true) if 'label' has been defined and 0 (false) otherwise.
Function REF returns 1 (true) if 'label' has been referenced or is defined, and 0 (false) otherwise.
Function PASSDEF returns 1 (true) if 'label' has been defined in current assembly pass. It can be used to conditionally define labels.
Function STRLEN returns length of the string argument.
Examples:
IF !PASSDEF(errno) ; 'errno' not defined yet? errno: DC.L 0 ; conditional definition is not going to cause ENDIF ; phase error thanks to PASSDEF() function IF REF(msg) && !PASSDEF(msg) ; if 'msg' was referenced, but not defined msg: DC.B "Message...", 0 ; then define 'msg' now ENDIF
Current origin value.
Start of simulator I/O area.
Assembler version.