Arm Assembler Directives New
Arm Assembler Directives New
1) Label (optional)
2) Opcode/Instruction Mnemonic (must be white space in front)
3) Operand (any required machine code operands)
4) Comment (usually after a semi-colon)
COMMENT
• Also useful for flagging the destination line for a branch instruction.
• Some assemblers allow for an optional colon (:) after the label and some
don’t. Labels may or may not be case-sensitive depending on the
assembler and settings.
Operand Field
- Text that follows a mnemonic is treated as an operand (3rd column)
MOV R0, #0x0280
Comments are used to make notes about what you are doing.
There are a couple of ways to enter a comment:
1. The fourth column of the text file is treated as a comment field.
2. Place a semicolon (;) in front of the comment to make it readable and
Ensure the assembler treats what follows it as a comment.
The assembler disregards comments because they are only for the
programmer’s use and are no use to the assembler.
Ex) MOV R4,#0x55 ; this instruction initializes 0x55 into R4 and zeroes
; out the upper 24 bits
2. Placing a semicolon (;) as the first character of a line. The entire line Is treated as a comment.
Ex) ; start of code
; Start MOV R4,#0x55 ; this line will be skipped by the assembler
• EX
AREA FIRST,CODE,READONLY
AREA AA,DATA,READWRITE