Chapter 9 Writing Machine Language Instructions and Directive Statements

9.4.11 ds

Syntax

label

operation

operand

[name]

ds

 

expression1 [, expression2 [, expression3]]

 

expression1

Number of bytes of memory to reserve

 

expression2

Initial value

 

 

expression3

Number of iterations

Default settings

expression2 (initial value) If omitted, the assembler will assume 0. expression3 (iterations) If omitted, the assembler will assume 1.

Functional description

This directive reserves a memory area of the number of bytes specified by expression1 of the operand. When expression2 (initial value) is specified, that memory area will be filled with the initial value. Note that expression2 can be specified only when the value of expression1 is 4 or less. When expression3 (iterations) is specified, the same specification will be repeated for the number of iterations. For example, if the operand is 4, 0, 3, a 4-byte area will be filled with 0 three times. Thus, a 12-byte area will be reserved.

When a name is coded for the label, the assembler will assign the current location counter value to that name.

Operand coding rules

The expression1 (bytes), expression2 (initial value), and expression3 (iterations) coded in the operand must result in the attribute abs (absolute). Refer to section 8.7.4, "Expression Attributes", regarding attributes of expressions.

NOTE:

When expression2 is omitted, expression3 cannot be specified.

 

 

 

Writing Directive Statements 167

Page 179
Image 179
Panasonic MN1030 user manual 11 ds, When expression2 is omitted, expression3 cannot be specified