1 Introduction 1-1
1.1 About this manual 1-2
1.2 Feedback 1-3
2 Getting Started 2-1
2.1 Introducing the Toolkit 2-2
2.2 The Hello World Example 2-4
3 Programmer��s Model 3-1
3.1 Introduction 3-2
3.2 Memory Formats 3-3
3.3 Instruction Length 3-4
3.4 Data Types 3-4
3.5 Processor Modes 3-4
3.6 Processor States 3-5
3.7 The ARM Register Set 3-6
3.8 The Thumb Register Set 3-8
3.9 Program Status Registers 3-10
3.10 Exceptions 3-12"
4 ARM Assembly Language Basics 4-1
4.1 Introduction 4-2
4.2 Structure of an Assembler Module 4-4
4.3 Conditional Execution 4-6
4.4 The ARM’s Barrel Shifter 4-10
4.5 Loading Constants Into Registers 4-14
4.6 Loading Addresses Into Registers 4-17
4.7 Jump Tables4-21
4.8 Using the Load and Store Multiple Instructions 4-23
5 Exploring ARM Assembly Language 5-1
5.1 Introduction 5-2
5.2 Integer to String Conversion 5-3
5.3 Multiplication by a Constant 5-8
5.4 Division by a Constant 5-12
5.5 Using 16-bit Data on the ARM 5-17
5.6 Pseudo Random Number Generation 5-25
5.7 Loading a Word from an Unknown Alignment 5-27
5.8 Byte Order Reversal 5-28
5.9 ARM Assembly Programming Performance Issues 5-29
6 Programming in C for the ARM 6-1
6.1 Introduction 6-2
6.2 Writing Efficient C for the ARM 6-3
6.3 Improving Code Size and Performance 6-11
6.4 Choosing a Division Implementation 6-14
6.5 Using the C Library in Deeply Embedded Applications 6-17
7 Interfacing C and Assembly Language 7-1
7.1 Introduction 7-2
7.2 Using the ARM Procedure Call Standard 7-3
7.3 Passing and Returning Structures 7-9
8 Advanced Linking 8-1
8.1 Using Overlays 8-2
8.2 ARM Shared Libraries 8-8
9 Writing Code for ROM 9-1
9.1 Introduction 9-2
9.2 Application Startup 9-2
9.3 Using the C Library in ROM 9-14
9.4 Troubleshooting Hints and Tips 9-18
10 The ARMulator 10-1
10.1 The ARMulator 10-2
10.2 Using the ARMulator Rapid Prototype Memory Model 10-4
10.3 Writing Custom Serial Drivers for ARM Debuggers 10-11
10.4 Rebuilding the ARMulator 10-13
11 Exceptions 11-1
11.1 Overview 11-2
11.2 Entering and Leaving an Exception 11-5
11.3 The Return Address and Return Instruction 11-6
11.4 Writing an Exception Handler 11-8
11.5 Installing an Exception Handler 11-12
11.6 Exception Handling on Thumb-Aware Processors 11-14
12 Implementing SWIs 12-1
12.1 Introduction 12-2
12.2 Implementing a SWI Handler 12-7
12.3 Loading the Vector Table 12-9
12.4 Calling SWIs from your Application 12-11
12.5 Development Issues: SWI Handlers and Demon 12-15
12.6 Example SWI Handler 12-18
13 Benchmarking, Performance Analysis, and Profiling 13-1
13.1 Introduction 13-221
13.2 Measuring Code and Data size 13-3
13.3 Timing Program Execution Using the ARMulator 13-5
13.4 Profiling Programs using the ARMulator 13-9
14 Using the Thumb Instruction Set 14-1
14.1 Working with Thumb Assembly Language 14-2
14.2 Hand-optimising the Thumb Compiler’s Output 14-5
14.3 ARM/Thumb Interworking 14-8
14.4 Division by a Constant in Thumb Code 14-12