Everything

.SET


Defines a name having an absolute-expression value.

[Syntax]

Symbol field
Mnemonic field
Operand field
Comment field
name
.SET
absolute-expression
[; comment]

[Function]

Defines a name having a absolute-expression value specified by the operand field.

[Use]

-

You can use this directive to define names for numerical data that can be used instead of the actual numbers in the operands of machine-language instructions and directives in source code.

-

We recommend defining frequently used numerical values as names. Even if a given value in the source program is to be changed, you will only need to change the value corresponding to the name.

[Description]

-

The .SET directive may be described anywhere in a source program.

-

Each name is a redefinable name.

-

The name generated by the .SET directive cannot be externally defined by the .PUBLIC directive.

-

The operand value is in accordance with "(a) Absolute expression". An illegal value will lead to an error.

-

A value between 0x00000000 and 0xFFFFFFFF can be specified as an absolute expression in the operand field.

-

This directive differs from the .EQU directive in that a symbol with a bit position specification cannot be defined.

-

Operators that generate a relocatable term as a result of calculation are not allowed in the operand field.

[Example]

To specify a constant expression.

SYM1    .SET    10
        MOV     A, #SYM1

 

To specify SFR symbols.

SYM2    .SET    P0
        MOV     SYM2, #2