Operator - Epson S1C62 Family Reference Manual

Cmos 4-bit single chip microcomputer development tool
Table of Contents

Advertisement

Operator

4.4.3
When specifying a value for an item such as an operand, an operational expression can be written instead
of a constant, and its result can be used as the value.
Labels and symbols as well as constants can be used as terms in expressions. These values are processed as
13-bit data (bit 14 and subsequent high-order bits are ignored); the operation result also consists of 13 bits.
If the result exceeds the number of significant digits of the instruction operand, an error occurs.
There are three types of operator—arithmetic, logical, and relational—as listed below (a and b represent
terms, and _ represents one or more blanks).
Arithmetic operators
There are 11 arithmetic operators including the ones for addition, subtraction, multiplication, division,
bit shifting, and bit separation.
+a
Monadic positive (indicates the subsequent value is positive)
-a
Monadic negative (indicates the subsequent value is negative)
Addition (unsigned)
a+b
a-b
Subtraction (unsigned)
a*b
Multiplication (unsigned)
a/b
Division (unsigned)
Remainder of a/b
a_MOD_b
a_SHL_b
Shifts a b bits to the left.
Example:
a_SHR_b
Shifts a b bits to the right. 0 [b7>>>>>>b0]
Example:
Separates the high-order eight bits from a (13 bits).
HIGH_a
Example:
LOW_a
Separates the low-order eight bits from a (13 bits).
Example:
Logical operators
There are four logical operators as listed below. The logical operator returns the result of logical
operation on the specified terms.
a_AND_b
Logical product
Example:
Logical sum
a_OR_b
Example:
Exclusive logical sum
a_XOR_b
Example:
NOT_a
Logical negation
Example:
S1C62 FAMILY
DEVELOPMENT TOOL REFERENCE MANUAL
[b7<<<<<<b1] 0
00000011B SHL 2
11000011B SHR 2
HIGH 1234H
12H
LOW 1234H
34H
00001111B AND 00000011B
00001111B OR 11110000B
00001111B XOR 00000011B
NOT 00001111B
EPSON
CROSS ASSEMBLER ASM62XX
00001100B
00110000B
00000011B
11111111B
00001100B
11110000B
III-9

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c62 series

Table of Contents