Writing ARM and Thumb Assembly Language
2-2
Copyright © 2000, 2001 ARM Limited. All rights reserved.
ARM DUI 0068B
2.1
Introduction
This chapter gives a basic, practical understanding of how to write ARM and Thumb
assembly language modules. It also gives information on the facilities provided by the
ARM assembler
(armasm).
This chapter does not provide a detailed description of the ARM, Thumb, or VFP
instruction sets. This information can be found in Chapter 4
ARM Instruction
Reference
, Chapter 5
Thumb Instruction Reference
, and Chapter 6
Vector
Floating-point Programming
. Further information can be found in
ARM Architecture
Reference Manual
.
2.1.1
Code examples
There are a number of code examples in this chapter. Many of them are supplied in the
examples\asm
directory of the ADS.
Follow these steps to build, link, and execute an assembly language file:
1.
Type
armasm -g
filename
.s
at the command prompt to assemble the file and
generate debug tables.
2.
Type
armlink
filename
.o -o
filename
to link the object file and generate an ELF
executable image.
3.
Type
armsd
filename
to load the image file into the debugger.
4.
Type
go
at the
armsd:
prompt to execute it.
5.
Type
quit
at the
armsd:
prompt to return to the command line.
To see how the assembler converts the source code, enter:
fromelf -text/c
filename
.o
or run the module in AXD with interleaving on.
See:
•
AXD and armsd Debuggers Guide
for details on armsd, and AXD.
•
ADS Linker and Utilities Guide
for details on
armlink
and
fromelf
.