Keil Logo

Technical Support

On-Line Manuals

Compiler Reference Guide

Preface Arm Compiler Tools Overview armclang Reference armlink Reference fromelf Reference armar Reference armasm Legacy Assembler Reference armasm Command-line Options --16 --32 --apcs=qualifier…qualifier --arm --arm_only --bi --bigend --brief_diagnostics, --no_brief_diagnostics --checkreglist --cpreproc --cpreproc_opts=option[,option,…] --cpu=list (armasm) --cpu=name (armasm) --debug --depend=dependfile --depend_format=string --diag_error=tag[,tag,…] (armasm) --diag_remark=tag[,tag,…] (armasm) --diag_style={arm|ide|gnu} (armasm) --diag_suppress=tag[,tag,…] (armasm) --diag_warning=tag[,tag,…] (armasm) --dllexport_all --dwarf2 --dwarf3 --errors=errorfile --exceptions, --no_exceptions --exceptions_unwind, --no_exceptions_unwind --execstack, --no_execstack --execute_only --fpmode=model --fpu=list (armasm) --fpu=name (armasm) -g (armasm) --help (armasm) -idir[,dir, …] --keep (armasm) --length=n --li --library_type=lib --list=file --list= --littleend -m (armasm) --maxcache=n --md --no_code_gen --no_esc --no_hide_all --no_regs --no_terse --no_warn -o filename (armasm) --pd --predefine "directive" --reduce_paths, --no_reduce_paths --regnames --report-if-not-wysiwyg --show_cmdline (armasm) --thumb --unaligned_access, --no_unaligned_access --unsafe --untyped_local_labels --version_number (armasm) --via=filename (armasm) --vsn (armasm) --width=n --xref Structure of armasm Assembly Language Modules Syntax of source lines in armasm syntax assembly l Literals ELF sections and the AREA directive An example armasm syntax assembly language module Writing A32/T32 Instructions in armasm Syntax Asse About the Unified Assembler Language Syntax differences between UAL and A64 assembly la Register usage in subroutine calls Load immediate values Load immediate values using MOV and MVN Load immediate values using MOV32 Load immediate values using LDR Rd, =const Literal pools Load addresses into registers Load addresses to a register using ADR Load addresses to a register using ADRL Load addresses to a register using LDR Rd, =label Other ways to load and store registers Load and store multiple register instructions Load and store multiple register instructions in A Stack implementation using LDM and STM Stack operations for nested subroutines Block copy with LDM and STM Memory accesses The Read-Modify-Write operation Optional hash with immediate constants Use of macros Test-and-branch macro example Unsigned integer division macro example Instruction and directive relocations Symbol versions Frame directives Exception tables and Unwind tables Using armasm armasm command-line syntax Specify command-line options with an environment v Using stdin to input source code to the assembler Built-in variables and constants Identifying versions of armasm in source code Diagnostic messages Interlocks diagnostics Automatic IT block generation in T32 code T32 branch target alignment T32 code size diagnostics A32 and T32 instruction portability diagnostics T32 instruction width diagnostics Two pass assembler diagnostics Using the C preprocessor Address alignment in A32/T32 code Address alignment in A64 code Instruction width selection in T32 code Symbols, Literals, Expressions, and Operators in a Symbol naming rules Variables Numeric constants Assembly time substitution of variables Register-relative and PC-relative expressions Labels Labels for PC-relative addresses Labels for register-relative addresses Labels for absolute addresses Numeric local labels Syntax of numeric local labels String expressions String literals Numeric expressions Syntax of numeric literals Syntax of floating-point literals Logical expressions Logical literals Unary operators Binary operators Multiplicative operators String manipulation operators Shift operators Addition, subtraction, and logical operators Relational operators Boolean operators Operator precedence Difference between operator precedence in assembly armasm Directives Reference Alphabetical list of directives armasm assembly la About armasm assembly language control directives About frame directives Directives that can be omitted in pass 2 of the as ALIAS ALIGN AREA ARM or CODE32 directive ASSERT ATTR CN CODE16 directive COMMON CP DATA DCB DCD and DCDU DCDO DCFD and DCFDU DCFS and DCFSU DCI DCQ and DCQU DCW and DCWU END ENDFUNC or ENDP ENTRY EQU EXPORT or GLOBAL EXPORTAS FIELD FRAME ADDRESS FRAME POP FRAME PUSH FRAME REGISTER FRAME RESTORE FRAME RETURN ADDRESS FRAME SAVE FRAME STATE REMEMBER FRAME STATE RESTORE FRAME UNWIND ON FRAME UNWIND OFF FUNCTION or PROC GBLA, GBLL, and GBLS GET or INCLUDE IF, ELSE, ENDIF, and ELIF IMPORT and EXTERN INCBIN INFO KEEP LCLA, LCLL, and LCLS LTORG MACRO and MEND MAP MEXIT NOFP OPT QN, DN, and SN RELOC REQUIRE REQUIRE8 and PRESERVE8 RLIST RN ROUT SETA, SETL, and SETS SPACE or FILL THUMB directive TTL and SUBT WHILE and WEND WN and XN armasm-Specific A32 and T32 Instruction Set Featur armasm support for the CSDB instruction A32 and T32 pseudo-instruction summary ADRL pseudo-instruction CPY pseudo-instruction LDR pseudo-instruction MOV32 pseudo-instruction NEG pseudo-instruction UND pseudo-instruction Appendixes

armasm Legacy Assembler Reference

Part F armasm Legacy Assembler Reference

Table of Contents

F1 armasm Command-line Options
F1.1 --16
F1.2 --32
F1.3 --apcs=qualifier…qualifier
F1.4 --arm
F1.5 --arm_only
F1.6 --bi
F1.7 --bigend
F1.8 --brief_diagnostics, --no_brief_diagnostics
F1.9 --checkreglist
F1.10 --cpreproc
F1.11 --cpreproc_opts=option[,option,…]
F1.12 --cpu=list (armasm)
F1.13 --cpu=name (armasm)
F1.14 --debug
F1.15 --depend=dependfile
F1.16 --depend_format=string
F1.17 --diag_error=tag[,tag,…] (armasm)
F1.18 --diag_remark=tag[,tag,…] (armasm)
F1.19 --diag_style={arm|ide|gnu} (armasm)
F1.20 --diag_suppress=tag[,tag,…] (armasm)
F1.21 --diag_warning=tag[,tag,…] (armasm)
F1.22 --dllexport_all
F1.23 --dwarf2
F1.24 --dwarf3
F1.25 --errors=errorfile
F1.26 --exceptions, --no_exceptions
F1.27 --exceptions_unwind, --no_exceptions_unwind
F1.28 --execstack, --no_execstack
F1.29 --execute_only
F1.30 --fpmode=model
F1.31 --fpu=list (armasm)
F1.32 --fpu=name (armasm)
F1.33 -g (armasm)
F1.34 --help (armasm)
F1.35 -idir[,dir, …]
F1.36 --keep (armasm)
F1.37 --length=n
F1.38 --li
F1.39 --library_type=lib
F1.40 --list=file
F1.41 --list=
F1.42 --littleend
F1.43 -m (armasm)
F1.44 --maxcache=n
F1.45 --md
F1.46 --no_code_gen
F1.47 --no_esc
F1.48 --no_hide_all
F1.49 --no_regs
F1.50 --no_terse
F1.51 --no_warn
F1.52 -o filename (armasm)
F1.53 --pd
F1.54 --predefine "directive"
F1.55 --reduce_paths, --no_reduce_paths
F1.56 --regnames
F1.57 --report-if-not-wysiwyg
F1.58 --show_cmdline (armasm)
F1.59 --thumb
F1.60 --unaligned_access, --no_unaligned_access
F1.61 --unsafe
F1.62 --untyped_local_labels
F1.63 --version_number (armasm)
F1.64 --via=filename (armasm)
F1.65 --vsn (armasm)
F1.66 --width=n
F1.67 --xref
F2 Structure of armasm Assembly Language Modules
F2.1 Syntax of source lines in armasm syntax assembly language
F2.2 Literals
F2.3 ELF sections and the AREA directive
F2.4 An example armasm syntax assembly language module
F3 Writing A32/T32 Instructions in armasm Syntax Assembly Language
F3.1 About the Unified Assembler Language
F3.2 Syntax differences between UAL and A64 assembly language
F3.3 Register usage in subroutine calls
F3.4 Load immediate values
F3.5 Load immediate values using MOV and MVN
F3.6 Load immediate values using MOV32
F3.7 Load immediate values using LDR Rd, =const
F3.8 Literal pools
F3.9 Load addresses into registers
F3.10 Load addresses to a register using ADR
F3.11 Load addresses to a register using ADRL
F3.12 Load addresses to a register using LDR Rd, =label
F3.13 Other ways to load and store registers
F3.14 Load and store multiple register instructions
F3.15 Load and store multiple register instructions in A32 and T32
F3.16 Stack implementation using LDM and STM
F3.17 Stack operations for nested subroutines
F3.18 Block copy with LDM and STM
F3.19 Memory accesses
F3.20 The Read-Modify-Write operation
F3.21 Optional hash with immediate constants
F3.22 Use of macros
F3.23 Test-and-branch macro example
F3.24 Unsigned integer division macro example
F3.25 Instruction and directive relocations
F3.26 Symbol versions
F3.27 Frame directives
F3.28 Exception tables and Unwind tables
F4 Using armasm
F4.1 armasm command-line syntax
F4.2 Specify command-line options with an environment variable
F4.3 Using stdin to input source code to the assembler
F4.4 Built-in variables and constants
F4.5 Identifying versions of armasm in source code
F4.6 Diagnostic messages
F4.7 Interlocks diagnostics
F4.8 Automatic IT block generation in T32 code
F4.9 T32 branch target alignment
F4.10 T32 code size diagnostics
F4.11 A32 and T32 instruction portability diagnostics
F4.12 T32 instruction width diagnostics
F4.13 Two pass assembler diagnostics
F4.14 Using the C preprocessor
F4.15 Address alignment in A32/T32 code
F4.16 Address alignment in A64 code
F4.17 Instruction width selection in T32 code
F5 Symbols, Literals, Expressions, and Operators in armasm Assembly Language
F5.1 Symbol naming rules
F5.2 Variables
F5.3 Numeric constants
F5.4 Assembly time substitution of variables
F5.5 Register-relative and PC-relative expressions
F5.6 Labels
F5.7 Labels for PC-relative addresses
F5.8 Labels for register-relative addresses
F5.9 Labels for absolute addresses
F5.10 Numeric local labels
F5.11 Syntax of numeric local labels
F5.12 String expressions
F5.13 String literals
F5.14 Numeric expressions
F5.15 Syntax of numeric literals
F5.16 Syntax of floating-point literals
F5.17 Logical expressions
F5.18 Logical literals
F5.19 Unary operators
F5.20 Binary operators
F5.21 Multiplicative operators
F5.22 String manipulation operators
F5.23 Shift operators
F5.24 Addition, subtraction, and logical operators
F5.25 Relational operators
F5.26 Boolean operators
F5.27 Operator precedence
F5.28 Difference between operator precedence in assembly language and C
F6 armasm Directives Reference
F6.1 Alphabetical list of directives armasm assembly language directives
F6.2 About armasm assembly language control directives
F6.3 About frame directives
F6.4 Directives that can be omitted in pass 2 of the assembler
F6.5 ALIAS
F6.6 ALIGN
F6.7 AREA
F6.8 ARM or CODE32 directive
F6.9 ASSERT
F6.10 ATTR
F6.11 CN
F6.12 CODE16 directive
F6.13 COMMON
F6.14 CP
F6.15 DATA
F6.16 DCB
F6.17 DCD and DCDU
F6.18 DCDO
F6.19 DCFD and DCFDU
F6.20 DCFS and DCFSU
F6.21 DCI
F6.22 DCQ and DCQU
F6.23 DCW and DCWU
F6.24 END
F6.25 ENDFUNC or ENDP
F6.26 ENTRY
F6.27 EQU
F6.28 EXPORT or GLOBAL
F6.29 EXPORTAS
F6.30 FIELD
F6.31 FRAME ADDRESS
F6.32 FRAME POP
F6.33 FRAME PUSH
F6.34 FRAME REGISTER
F6.35 FRAME RESTORE
F6.36 FRAME RETURN ADDRESS
F6.37 FRAME SAVE
F6.38 FRAME STATE REMEMBER
F6.39 FRAME STATE RESTORE
F6.40 FRAME UNWIND ON
F6.41 FRAME UNWIND OFF
F6.42 FUNCTION or PROC
F6.43 GBLA, GBLL, and GBLS
F6.44 GET or INCLUDE
F6.45 IF, ELSE, ENDIF, and ELIF
F6.46 IMPORT and EXTERN
F6.47 INCBIN
F6.48 INFO
F6.49 KEEP
F6.50 LCLA, LCLL, and LCLS
F6.51 LTORG
F6.52 MACRO and MEND
F6.53 MAP
F6.54 MEXIT
F6.55 NOFP
F6.56 OPT
F6.57 QN, DN, and SN
F6.58 RELOC
F6.59 REQUIRE
F6.60 REQUIRE8 and PRESERVE8
F6.61 RLIST
F6.62 RN
F6.63 ROUT
F6.64 SETA, SETL, and SETS
F6.65 SPACE or FILL
F6.66 THUMB directive
F6.67 TTL and SUBT
F6.68 WHILE and WEND
F6.69 WN and XN
F7 armasm-Specific A32 and T32 Instruction Set Features
F7.1 armasm support for the CSDB instruction
F7.2 A32 and T32 pseudo-instruction summary
F7.3 ADRL pseudo-instruction
F7.4 CPY pseudo-instruction
F7.5 LDR pseudo-instruction
F7.6 MOV32 pseudo-instruction
F7.7 NEG pseudo-instruction
F7.8 UND pseudo-instruction
Non-ConfidentialPDF file icon PDF version101754_0613_00_en
Copyright © 2019 Arm Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.