.EQU


Defines a name having an absolute-expression value.

[Syntax]

Symbol field
Mnemonic field
Operand field
Comment field
name
.EQU
absolute-expression[.bit-position]
[; comment]
name
.EQU
PSW[.bit-position]
[; 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.

-

Symbols that have already been defined by using .EQU cannot be redefined.

-

The name generated by the .EQU directive can be externally defined by the .PUBLIC directive.

-

The following values can be specified as the operand.

-

Absolute expression

The absolute expression should be in accordance with "(a) Absolute expression".

-

PSW

When PSW is specified, the value is 0xFFFFA.

 

An illegal operand will cause an error.

-

A value between 0x00000000 and 0xFFFFFFFF can be specified as the operand, and a value between 0 and 7 can be specified as the bit position.

-

Relocatable terms cannot be specified in the operand field. In addition, 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    .EQU    10
        MOV     A, #SYM1

 

To specify a symbol.

SYM2    .EQU    0xFFE20
BSYM1   .EQU    SYM2.1
        SET1    BSYM1

 

To specify PSW.

SYM3    .EQU    PSW
        MOV     SYM3, #10

 

To specify a SFR symbol.

SYM4    .EQU    P0
        MOV     SYM4, #2