Expressions, Arithmetic operators – Zilog EZ80F916 User Manual

Page 212

Advertising
background image

UM014423-0607

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

192

Character Strings
Character strings consist of printable ASCII characters enclosed by double (

"

) or single

(

'

) quotes. A double quote used within a string delimited by double quotes and a single

quote used within a string delimited by single quotes must be preceded by a back slash (

\

).

A single quoted string consisting of a single character is treated as a character constant.
The assembler does not insert null character (0's) at the end of a text string automatically
unless a 0 is inserted, and a character string cannot be used as an operand. For example:

DB "STRING" ; a string
DB 'STRING',0 ; C printable string
DB "STRING\"S" ; embedded quote
DB 'a','b','c' ; character constants

EXPRESSIONS

In most cases, where a single integer or float value can be used as an operand, an expres-
sion can also be used. The assembler evaluates expressions in 32-bit signed arithmetic or
64-bit floating-point arithmetic. Logical expressions are bitwise operators.

The assembler detects overflow and division by zero errors in constant expressions. The
following sections describe the syntax of writing an expression:

•

“Arithmetic Operators” on page 192

•

“Relational Operators” on page 193

•

“Boolean Operators” on page 193

•

“HIGH and LOW Operators” on page 193

•

“HIGH16 and LOW16 Operators” on page 194

•

“Decimal Numbers” on page 194

•

“Hexadecimal Numbers” on page 194

•

“Binary Numbers” on page 195

•

“Octal Numbers” on page 195

•

“Character Constants” on page 195

•

“Operator Precedence” on page 195

Arithmetic Operators

<<

Left Shift

>>

Arithmetic Right Shift

**

Exponentiation

*

Multiplication

Advertising
This manual is related to the following products: