| |||
| Home > Directives Reference > Data definition directives > FIELD | |||
The FIELD directive describes space
within a storage map that has been defined using the MAP directive. # is
a synonym for FIELD.
{label} FIELD expr
where:
labelis an optional label. If specified, is
assigned the value of the storage location counter, label{VAR}.
The storage location counter is then incremented by the value of .expr
expris an expression that evaluates to the number of bytes to increment the storage counter.
If a storage map is set by a MAP directive that
specifies a base-register, the base register is
implicit in all labels defined by following FIELD directives,
until the next MAP directive. These register-relative
labels can be quoted in load and store instructions (see MAP).
You must be careful when using MAP, FIELD,
and register-relative labels. See Describing data structures with MAP
and FIELD directives for more information.
The following example shows how register-relative labels are
defined using the MAP and FIELD directives.
MAP 0,r9 ; set {VAR} to the address stored in r9
FIELD 4 ; increment {VAR} by 4 bytes
Lab FIELD 4 ; set Lab to the address [r9 + 4]
; and then increment {VAR} by 4 bytes
LDR r0,Lab ; equivalent to LDR r0,[r9,#4]