CHAPTER 4: ASSEMBLER

Other numerical notations

The following numerical notations can also be used: nnnnB: Binary numbers

nnnnO: Octal numbers

nnnnQ: Octal numbers

nnnnH: Hexadecimal numbers

"nnnnB" (binary numbers) and "nnnnH" (hexadecimal numbers) are converted into the new format ("0bnnnn" and "0xnnnn") in the preprocessing stage.

"nnnnO" and "nnnnQ" (octal numbers) are converted into hexadecimal numbers ("0xnnnn") in the preprocessing stage.

ASCII to HEX conversion

One or two ASCII characters (enclosed with ' ') can be described in source files unless converting into numbers. The numeric operators can also be used. The described characters are converted into ASCII codes and delivered to the output relocatable object file.

Examples: retd

'1'

(retd

0x31)

retd

'23'

(retd

0x3233)

retd

'4'+1

(retd

0x35)

Note: Three or more characters and the following characters cannot be described: Control codes (0x0 to 0x1f) space @ [ ] ; ,

4.5.8 Operators

An expression that consists of operators, numbers and/or defined symbols (including labels) can be used for specifying a number or defining a Define name (only for number definition).

The preprocess in the assembler handles expressions in signed 16-bit data and expands them as hexadecimal numbers.

Types of operators
Arithmetic operators

Examples

 

+

Addition, Plus sign

+0xff, 1+2

 

-

Subtraction, Minus sign

-1+2, 0xff-0b111

 

*

Multiplication

0xf*5

 

/

Division

0x123/0x56

 

%

Residue

0x123%0x56

(%% is also be supported.)

>>

Shifting to right

1>>2

 

<<

Shifting to left

0x113<<3

 

^H

Acquires upper 8 bits

0x1234^H

 

^L

Acquires lower 8 bits

0x1234^L

 

( )

Parenthesis

1+(1+2*5)

 

The arithmetic operator returns the result of arithmetic operation on the specified terms.

Logical operators

Examples

&

Bit AND

0b1101&0b111

Bit OR

0b1230xff

^

Bit XOR

12^35

~

Bit inversion

~0x1234

The logical operator returns the result of logic operation on the specified terms.

58

EPSON

S5U1C63000A MANUAL

 

 

(S1C63 FAMILY ASSEMBLER PACKAGE)