ARCHITECTURE AND INSTRUCTIONS

Labels in instruction statements are always optional; names in directive statements can be mandatory, optional, or prohibited, depend- ing on the particular directive.

Mnemonics in instruction statements specify the purpose of the statement. Directives, in directive statements, specify the purpose of the statement. The instruction mgemonics correspond to the set of approximately 100 opcodes available in the 8088. The directives correspond to the set of some 20 functions provided by the ASM-86 assembler (Fig.

2-14).

The mnemonic or directive may require addi- tional information to define its purpose completely. This information is provided by' a sequence of arguments.

Optional comments make the program more readable; when present they must be pre- ceded by a semicolon.

Directive Statements

The various directive statements in ASM-86 are:

1)symbol-definition

2)data-definition

3)segmentation-definition

4)procedure-definition

5)termination

Symbol-Definition Statements

The EQU statement provides a means for defining symbolic names to represent values or other symbolic names. The two forms of the EQU statement are illustrated:

name EQU expression

new name EQU old_name

Some examples are:

BOILING_POINT EQU 212

BUFFEFLSIZE EQU 32

NEW_PORT EQU PORT_VAL+1

COUNTEQU CS

The last example differs from the other three in that COUNT does not represent a value; it is a synonym for the ex register.

A symbolic name can be "undefined" by a PURGE statement so it may later represent something entirely different:

PURGE

Data-Definition Statements Data-definition allocates memory for a data item, associates a symbolic name with that memory address, and optionally supplies an initial value for the data. Symbolic names associated with data items are called vari- ables. Examples of data-definition statements

are: (see below)

.

In the example below, THING is a symbolic name associated with a byte in memory, BIGGER_THING with two consecutive bytes in memory, and BIGGEST_THING with four consecutive bytes in memory.

Initial Values

Before we can discuss the question marks (?), we need to introduce the concept of initial values of data items.

The object code produced by the assembler contains the l's and O's that make up each instructIon and the memory address at which each instruction should reside. Mter the object code is produced, the instructions are

THING

DB

?

;defines a byte

BIGGER_THING

OW

?

;defines a word (2 bytes)

BIGGEST_THING

DO

?

;defines a doubleword (4 bytes)

2-28

Page 63
Image 63
Intel 210200-002 manual Some examples are