ARM® Developer Suite Version 1.1
Total Page:16
File Type:pdf, Size:1020Kb
ARM® Developer Suite Version 1.1 Assembler Guide Copyright © 2000 ARM Limited. All rights reserved. ARM DUI 0068A ARM Developer Suite Assembler Guide Copyright © 2000 ARM Limited. All rights reserved. Release Information The following changes have been made to this book. Change History Date Issue Change November 2000 A Release 1.1 Proprietary Notice Words and logos marked with ® or ™ are registered trademarks or trademarks owned by ARM Limited. Other brands and names mentioned herein may be the trademarks of their respective owners. Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder. The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded. This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product. ii Copyright © 2000 ARM Limited. All rights reserved. ARM DUI 0068A Contents Assembler Guide Preface About this book .............................................................................................. vi Feedback ....................................................................................................... ix Chapter 1 Introduction 1.1 About the ARM Developer Suite assemblers .............................................. 1-2 Chapter 2 Writing ARM and Thumb Assembly Language 2.1 Introduction ................................................................................................. 2-2 2.2 Overview of the ARM architecture .............................................................. 2-3 2.3 Structure of assembly language modules ................................................. 2-12 2.4 Conditional execution ................................................................................ 2-19 2.5 Loading constants into registers ............................................................... 2-24 2.6 Loading addresses into registers .............................................................. 2-29 2.7 Load and store multiple register instructions ............................................. 2-38 2.8 Using macros ............................................................................................ 2-47 2.9 Describing data structures with MAP and FIELD directives ...................... 2-50 2.10 Using frame directives ............................................................................... 2-65 Chapter 3 Assembler Reference 3.1 Command syntax ........................................................................................ 3-2 3.2 Format of source lines ................................................................................ 3-8 ARM DUI 0068A Copyright © 2000 ARM Limited. All rights reserved. iii Confidential Draft Contents 3.3 Predefined register and coprocessor names .............................................. 3-9 3.4 Built-in variables ....................................................................................... 3-10 3.5 Symbols .................................................................................................... 3-12 3.6 Expressions, literals, and operators ......................................................... 3-18 Chapter 4 ARM Instruction Reference 4.1 Conditional execution ................................................................................. 4-4 4.2 ARM memory access instructions .............................................................. 4-6 4.3 ARM general data processing instructions ............................................... 4-23 4.4 ARM multiply instructions ......................................................................... 4-39 4.5 ARM saturating arithmetic instructions ..................................................... 4-54 4.6 ARM branch instructions .......................................................................... 4-56 4.7 ARM coprocessor instructions .................................................................. 4-61 4.8 Miscellaneous ARM instructions ............................................................... 4-70 4.9 ARM pseudo-instructions ......................................................................... 4-76 Chapter 5 Thumb Instruction Reference 5.1 Thumb memory access instructions ........................................................... 5-4 5.2 Thumb arithmetic instructions ................................................................... 5-15 5.3 Thumb general data processing instructions ............................................ 5-22 5.4 Thumb branch instructions ....................................................................... 5-31 5.5 Thumb software interrupt and breakpoint instructions .............................. 5-37 5.6 Thumb pseudo-instructions ...................................................................... 5-39 Chapter 6 Vector Floating-point Programming 6.1 The vector floating-point coprocessor ........................................................ 6-4 6.2 Floating-point registers ............................................................................... 6-5 6.3 Vector and scalar operations ...................................................................... 6-7 6.4 VFP and condition codes ............................................................................ 6-8 6.5 VFP system registers ............................................................................... 6-10 6.6 Flush-to-zero mode .................................................................................. 6-13 6.7 VFP instructions ....................................................................................... 6-15 6.8 VFP pseudo-instruction ............................................................................ 6-34 6.9 VFP directives and vector notation ........................................................... 6-35 Chapter 7 Directives Reference 7.1 Alphabetical list of directives ...................................................................... 7-2 7.2 Symbol definition directives ........................................................................ 7-3 7.3 Data definition directives .......................................................................... 7-12 7.4 Assembly control directives ...................................................................... 7-25 7.5 Frame description directives ..................................................................... 7-31 7.6 Reporting directives .................................................................................. 7-42 7.7 Miscellaneous directives ........................................................................... 7-47 Glossary iv Copyright © 2000 ARM Limited. All rights reserved. ARM DUI 0068A Confidential Draft Preface This preface introduces the documentation for the ARM Developer Suite (ADS) assemblers and assembly language. It contains the following sections: • About this book on page vi • Feedback on page ix. ARM DUI 0068A Copyright © 2000 ARM Limited. All rights reserved. v Preface About this book This book provides tutorial and reference information for the ADS assemblers (armasm, the free-standing assembler, and inline assemblers in the C and C++ compilers). It describes the command-line options to the assembler, the pseudo-instructions and directives available to assembly language programmers, and the ARM, Thumb®,and Vector Floating-point (VFP) instruction sets. Intended audience This book is written for all developers who are producing applications using ADS. It assumes that you are an experienced software developer and that you are familiar with the ARM development tools as described in ADS Getting Started. Using this book This book is organized into the following chapters: Chapter 1 Introduction Read this chapter for an introduction to the ADS version 1.1 assemblers and assembly language. Chapter 2 Writing ARM and Thumb Assembly Language Read this chapter for tutorial information to help you use the ARM assemblers and assembly language. Chapter 3 Assembler Reference Read this chapter for reference material about the syntax and structure of the language provided by the ARM assemblers. Chapter 4 ARM Instruction Reference Read this chapter for reference material on the ARM instruction set. Chapter 5 Thumb Instruction Reference Read this chapter for reference material on the Thumb instruction set. Chapter 6 Vector Floating-point Programming Read this chapter for reference material on the VFP instruction set, and other VFP-specific assembly language information. Chapter 7 Directives Reference Read this chapter for reference material on the assembler directives available in the ARM assembler, armasm. vi Copyright © 2000 ARM Limited. All rights reserved. ARM DUI 0068A Preface Typographical conventions The following typographical conventions are used in this book: typewriter Denotes text that can be entered at the keyboard, such as commands, file and program names, and source code. typewriter Denotes a permitted abbreviation for a command or option. The underlined text can be