05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Instruction Details<br />

A8.1.4 Assembler syntax<br />

Encoding-specific pseudocode. This is pseudocode that translates the encoding-specific instruction<br />

fields into inputs to the encoding-independent pseudocode in the later Operation subsection, <strong>and</strong> that<br />

picks out any special cases in the encoding. For a detailed description of the pseudocode used <strong>and</strong> of<br />

the relationship between the encoding diagram, the encoding-specific pseudocode <strong>and</strong> the<br />

encoding-independent pseudocode, see Appendix I Pseudocode Definition.<br />

The Assembly syntax subsection describes the st<strong>and</strong>ard UAL syntax for the instruction.<br />

Each syntax description consists of the following elements:<br />

One or more syntax prototype lines written in a typewriter font, using the conventions described in<br />

Assembler syntax prototype line conventions on page A8-5. Each prototype line documents the<br />

mnemonic <strong>and</strong> (where appropriate) oper<strong>and</strong> parts of a full line of assembler code. When there is more<br />

than one such line, each prototype line is annotated to indicate required results of the<br />

encoding-specific pseudocode. For each instruction encoding, this information can be used to<br />

determine whether any instructions matching that encoding are available when assembling that<br />

syntax, <strong>and</strong> if so, which ones.<br />

The line where: followed by descriptions of all of the variable or optional fields of the prototype<br />

syntax line.<br />

Some syntax fields are st<strong>and</strong>ardized across all or most instructions. St<strong>and</strong>ard assembler syntax fields<br />

on page A8-7 describes these fields.<br />

By default, syntax fields that specify registers, such as , , or , can be any of R0-R12 or<br />

LR in Thumb instructions, <strong>and</strong> any of R0-R12, SP or LR in <strong>ARM</strong> instructions. These require that the<br />

encoding-specific pseudocode set the corresponding integer variable (such as d, n, or t) to the<br />

corresponding register number (0-12 for R0-R12, 13 for SP, 14 for LR). This can normally be done<br />

by setting the corresponding bitfield in the instruction (named Rd, Rn, Rt…) to the binary encoding<br />

of that number. In the case of 16-bit Thumb encodings, this bitfield is normally of length 3 <strong>and</strong> so the<br />

encoding is only available when one of R0-R7 is specified in the assembler syntax. It is also common<br />

for such encodings to use a bitfield name such as Rdn. This indicates that the encoding is only<br />

available if <strong>and</strong> specify the same register, <strong>and</strong> that the register number of that register is<br />

encoded in the bitfield if they do.<br />

The description of a syntax field that specifies a register sometimes extends or restricts the permitted<br />

range of registers or documents other differences from the default rules for such fields. Typical<br />

extensions are to permit the use of the SP in Thumb instructions <strong>and</strong> to permit the use of the PC (using<br />

register number 15).<br />

Where appropriate, text that briefly describes changes from the pre-UAL <strong>ARM</strong> assembler syntax.<br />

Where present, this usually consists of an alternative pre-UAL form of the assembler mnemonic. The<br />

pre-UAL <strong>ARM</strong> assembler syntax does not conflict with UAL, <strong>and</strong> support for it is a recommended<br />

optional extension to UAL, to enable the assembly of pre-UAL <strong>ARM</strong> assembler source files.<br />

A8-4 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!