11-05-2012, 04:50 PM
Programming Techniques
ARM_Book.pdf (Size: 2.16 MB / Downloads: 29)
Introduction
This manual is designed to help programmers rapidly exploit the power of the ARM processor for
embedded applications. The material has been written by ARM staff who have accumulated
considerable experience with software for the ARM and Thumb microprocessors.
We have targeted this manual at embedded systems programmers who have some experience
with other architectures, and who wish to quickly learn how to use an ARM chip.
A broad spectrum of topics is covered, from introductory illustrations through to complex
examples. It has been organised by theme, for example:
• Programmer’s Model
This chapter describes the ARM architecture. It includes details for system
programmers writing supervisor code and exception handlers.
• Programming in C for the ARM
This chapter is essential reading for developers who wish to optimise their code for high
performance and minimum size. It describes how to write C which compiles efficiently.
This approach can yield considerable gains without resorting to assembly language.
The Hello World Example
This example shows you how to write, compile, link and execute a simple C program that prints
“Hello World” and a carriage return on the screen. The code will be generated on a text editor,
compiled and linked using armcc, and run on armsd.
Generating assembly language from C
The compiler can also generate assembly language from C. Quit the debugger and enter:
armcc -S hello.c
at the system prompt.
The -S flag instructs armcc to write out an assembly language listing of the instructions that
would normally be compiled into executable code. By default the output file will have the same
name as the C source file, but with the extension .s.