5.8.3. # directive

The # directive describes space within a storage map that has been defined using the ^ directive.

Syntax

The syntax of # is:

{label} # expression

where:

label

is an optional label. If specified, label is assigned the value of the storage location counter, @. The storage location counter is then incremented by the value of expression.

expression

is an expression that evaluates to the number of bytes to increment the storage counter.

Usage

If a storage map is set by a ^ directive that specifies a base-register, the base register is implicit in all labels defined by following # directives, until the next ^ directive. These register-relative labels can be quoted in load and store instructions. Refer to ^ or MAP directive.

Note

You must be careful when using ^, #, and register-relative labels. Refer to Chapter 5 Basic Assembly Language Programming in the ARM Software Development Toolkit User Guide for more information.

Example

The following example shows how register-relative labels are defined using the ^ and # directives.

		^ 		0,r9			; set @ to the address stored in r9
		# 		4			; increment @ by 4 bytes
Lab		# 		4			; set Lab to the address [r9 + 4] 
							; and then increment @ by 4 bytes
		LDR 		r0,Lab			; equivalent to LDR r0,[r9,#4]
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0041C
Non-Confidential