beautypg.com

Expressions, Arithmetic operators, Assembler numeric representation – Zilog ZUSBOPTS User Manual

Page 248: Character strings

background image

Expressions

UM017105-0511

220

Zilog Developer Studio II – ZNEO™
User Manual

Do not use the instruction mnemonics or assembler directives as symbol or variable names.

Assembler Numeric Representation

Numbers are represented internally as signed 32-bit integers. The assembler detects an
expression operand that is out of range for the intended field and generates appropriate
error messages.

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 value can be used as an operand, an expression can
also be used. The assembler evaluates expressions in 32-bit signed arithmetic. Logical
expressions are bit-wise operators.

The assembler detects division-by-zero errors and reports an error message. The following
sections describe the syntax of writing an expression.

Arithmetic Operators

<<

Left Shift

>>

Arithmetic Right Shift

**

Exponentiation

*

Multiplication

/

Division

%

Modulus

Note:

This manual is related to the following products: