
2.15 Program Counter .................................................. .................................................. 2-50
2.16 Application Program Status Register ................................... ................................... 2-51
2.17 The Q flag ................................................................................................................ 2-52
2.18 Current Program Status Register ............................................................................ 2-53
2.19 Saved Program Status Registers ............................................................................ 2-54
2.20 ARM and Thumb instruction set overview ............................... ............................... 2-55
2.21 Access to the inline barrel shifter ...................................... ...................................... 2-56
Chapter 3 Structure of Assembly Language Modules
3.1 Syntax of source lines in assembly language .......................................................... 3-58
3.2 Literals .......................................................... .......................................................... 3-60
3.3 ELF sections and the AREA directive ...................................................................... 3-61
3.4 An example ARM assembly language module ........................................................ 3-62
Chapter 4 Writing ARM Assembly Language
4.1 About the Unified Assembler Language .................................................................. 4-65
4.2 Register usage in subroutine calls ..................................... ..................................... 4-66
4.3 Load immediate values ............................................................................................ 4-67
4.4 Load immediate values using MOV and MVN ............................ ............................ 4-68
4.5 Load immediate values using MOV32 .................................. .................................. 4-69
4.6 Load immediate values using LDR Rd, =const ........................... ........................... 4-70
4.7 Literal pools ...................................................... ...................................................... 4-71
4.8 Load addresses into registers ........................................ ........................................ 4-73
4.9 Load addresses to a register using ADR ................................ ................................ 4-74
4.10 Load addresses to a register using ADRL ............................... ............................... 4-76
4.11 Load addresses to a register using LDR Rd, =label ................................................ 4-77
4.12 Other ways to load and store registers .................................................................... 4-79
4.13 Load and store multiple register instructions ............................. ............................. 4-80
4.14 Load and store multiple register instructions in ARM and Thumb ............. ............. 4-81
4.15 Stack implementation using LDM and STM .............................. .............................. 4-82
4.16 Stack operations for nested subroutines ................................ ................................ 4-84
4.17 Block copy with LDM and STM ................................................................................ 4-85
4.18 Memory accesses .................................................................................................... 4-87
4.19 The Read-Modify-Write operation ..................................... ..................................... 4-88
4.20 Optional hash with immediate constants ................................ ................................ 4-89
4.21 Use of macros .................................................... .................................................... 4-90
4.22 Test-and-branch macro example ...................................... ...................................... 4-91
4.23 Unsigned integer division macro example ............................... ............................... 4-92
4.24 Instruction and directive relocations ........................................................................ 4-94
4.25 Symbol versions ...................................................................................................... 4-96
4.26 Frame directives ...................................................................................................... 4-97
4.27 Exception tables and Unwind tables ........................................................................ 4-98
4.28 Assembly language changes after RVCT v2.1 ........................................................ 4-99
Chapter 5 Condition Codes
5.1 Conditional instructions ............................................ ............................................ 5-102
5.2 Conditional execution in ARM state ................................... ................................... 5-103
5.3 Conditional execution in Thumb state ................................. ................................. 5-104
5.4 Updates to the condition flags ....................................... ....................................... 5-105
5.5 Condition code suffixes and related flags .............................................................. 5-106
ARM DUI0473M Copyright © 2010-2016 ARM Limited or its affiliates. All rights
reserved.
5
Non-Confidential