SLAU131V October 2004 – February 2020
Each line in a MSP430 assembly input file can be empty, a comment, an assembler directive, a macro invocation, or an assembly instruction.
Assembly language source statements can contain four ordered fields (label, mnemonic, operand list, and comment). The general syntax for source statements is as follows:
[label[:]]mnemonic [operand list][;comment] |
Following are examples of source statements:
SYM1 .set 2 ; Symbol SYM1 = 2
Begin: MOV.W #SYM1, R11 ; Load R11 with 2
.word 016h ; Initialize word (016h)
The MSP430 assembler reads an unlimited number of characters per line. Source statements that extend beyond 400 characters in length (including comments) are truncated in the listing file.
Follow these guidelines:
NOTE
A mnemonic cannot begin in column 1 or it will be interpreted as a label. Mnemonic opcodes and assembler directive names without the . prefix are valid label names. Remember to always use whitespace before the mnemonic, or the assembler will think the identifier is a new label definition.
The following sections describe each of the fields.