For example, if the clock has a frequency of 5 MHz (its period is 0.2 ms), then execution times for various forms of the ADD instruction can be computed as follows:

Add register to register (result put in register) requires:

Three clock cycles for either a byte or word operand
Time = 0.6 ms

Add memory to register using based indexed relative addressing (result put in register) requires:

9 + 12 = 21 cycles for byte or word operation with word at an even address
Time = 4.2 ms

9 + 12 + 4 = 25 cycles if word at an odd address
Time = 5.0 ms

Figure 3-2 Representative assembler language instruction.

The tokens may be variable identifiers or:

Constant
A number whose base is indicated by a suffix as follows:

B - binary
D - decimal
O - octal
H - hexadecimal

The default is decimal. The first digit in a hexadecimal number must be 0 through 9; therefore, if the most significant digit is a letter (A-F), then it must be prefixed with a 0. Examples are:

10112 = 1011B
22310 = 223D = 223
B25A16 = 0B25AH

String Constant
A character string enclosed in single quotes (').
Arithmetic operators
The operators "+", "-", "*" and "/".
Logical operators
The operators "AND", "OR", "NOT", and "XOR" (exclusive OR). The logical operations are performed by putting the operands in binary form and performing the operation on the corresponding pairs of bits.
Subexpressions
And expression that is part of another expression and is delimited from its parent expression by parentheses.
Name
An identifier that represents a constant, string constant, or expression.

Table of Contents | Next page | Previous page

This is page 22.