5.1.15 Bit position specifier

Bit access becomes possible via use of the ( . ) bit position specifier.

(1)

Description Format

address.bit-position

(2)

Function

The first term specifies an address, and the second term specifies a bit position. This makes it possible to access a specific bit.

(3)

Explanation

-

The term obtained through a bit position specifier is called a bit term, which has a bit value.

-

A bit term cannot be used as a term in an expression.

-

The bit position specifier is not affected by the precedence order of operators. The left side is recognized as the first term and the right side is recognized as the second term.

-

The following restrictions apply to the first term:

-

A bit term can be used as an operand for an instruction that handles bit data (such as MOV1) (For details, see the user's manual of the device).

-

If the first term is an absolute expression, the area must be 0x00000 to 0xFFFFF.

-

External reference names can be specified.

-

The following restrictions apply to the second term:

-

The value of the absolute expression must be in the range from 0 to 7. When this range is exceeded, an error occurs.

-

External reference names cannot be specified.

(4)

Operations and relocation attributes

The following table shows combinations of terms 1 and 2 by relocation attribute.

Terms combination X:

ABS

ABS

REL

REL

Terms combination Y:

ABS

REL

ABS

REL

X.Y

A

-

R

-

 

ABS : Absolute term

REL : Relocatable term

A : Result is absolute term

R : Result is relocatable term

- : Operation not possible

(5)

Example

MOV1    CY, 0xFFE20.3
AND1    CY, A.5
CLR1    P1.2
SET1    1 + 0xFFE30.3   ;Equals 0xFFE31.3 ((1 + 0xFFE30) is the first term and 3 
                        ;is the second term)
SET1    0xFFE40.4 + 2   ;Equals 0xFFE40.6 (0xFFE40 is the first term and (4 + 2) 
                        ;is the second term)