3 structure of assembly language modules, 1 layout of assembly language source files, Structure of assembly language modules -12 – ARM VERSION 1.2 User Manual

Page 24

Advertising
background image

Writing ARM and Thumb Assembly Language

2-12

Copyright © 2000, 2001 ARM Limited. All rights reserved.

ARM DUI 0068B

2.3

Structure of assembly language modules

Assembly language is the language that the ARM assembler (

armasm

) parses and

assembles to produce object code. This can be:

ARM assembly language

Thumb assembly language

a mixture of both.

2.3.1

Layout of assembly language source files

The general form of source lines in assembly language is:

{label} {instruction|directive|pseudo-instruction} {;comment}

Note

Instructions, pseudo-instructions, and directives must be preceded by white space, such
as a space or a tab, even if there is no label.

All three sections of the source line are optional. You can use blank lines to make your
code more readable.

Case rules

Instruction mnemonics, directives, and symbolic register names can be written in
uppercase or lowercase, but not mixed.

Line length

To make source files easier to read, a long line of source can be split onto several lines
by placing a backslash character ( \ ) at the end of the line. The backslash must not be
followed by any other characters (including spaces and tabs). The backslash/end-of-line
sequence is treated by the assembler as white space.

Note

Do not use the backslash/end-of-line sequence within quoted strings.

The exact limit on the length of lines, including any extensions using backslashes,
depends on the contents of the line, but is generally between 128 and 255 characters.

Advertising