beautypg.com

9 ds — define space, Ds — define space – Motorola HC12 User Manual

Page 173

background image

Assembler Directives

DS — Define Space

MCUez HC12 Assembler

User’s Manual

MOTOROLA

Assembler Directives

173

8.9 DS — Define Space

Syntax:

[

DS

[.]

where

= B (default), W, or L

Description:

The

DS

directive is used to reserve memory for variables. The

content of the reserved memory is not initialized. The length of
the block is * .

may not contain undefined, forward, or external
references. It may range from 1 to 4096.

Example:

Counter: DS.B 2

; 2 contiguous bytes in memory

DS.B 2

; 2 contiguous bytes in memory

; can only be accessed through the

; label Counter

DS.L 5

; 5 contiguous longwords in memory

The label,

Counter,

references the lowest address of the

defined storage area.