
Programming
1-7
1.7
ADDRESSING MODES
The Am186 and Am188 microcontrollers use eight categories of addressing modes to
specify operands. Two addressing modes are provided for instructions that operate on
register or immediate operands; six modes are provided to specify the location of an
operand in a memory segment.
Register and Immediate Operands
1. Register Operand Mode—The operand is located in one of the 8- or 16-bit registers.
2. Immediate Operand Mode—The operand is included in the instruction.
Memory Operands
A memory-operand address consists of two 16-bit components: a segment value and an
offset. The segment value is supplied by a 16-bit segment register either implicitly chosen
by the addressing mode (described below) or explicitly chosen by a segment override prefix
(see "Segment Override Prefix" on page 2-2). The offset, also called the effective address,
is calculated by summing any combination of the following three address elements:
n
Displacement—an 8-bit or 16-bit immediate value contained in the instruction
n
Base—contents of either the BX or BP base registers
n
Index—contents of either the SI or DI index registers
Any carry from the 16-bit addition is ignored. Eight-bit displacements are sign-extended to
16-bit values.
Combinations of the above three address elements define the following six memory
addressing modes (see Table 1-2 for examples).
1. Direct Mode—The operand offset is contained in the instruction as an 8- or 16-bit
displacement element.
2. Register Indirect Mode—The operand offset is in one of the BP, BX, DI, or SI registers.
3. Based Mode—The operand offset is the sum of an 8- or 16-bit displacement and the contents
of a base register (BP or BX).
4. Indexed Mode—The operand offset is the sum of an 8- or 16-bit displacement and the
contents of an index register (DI or SI).
5. Based Indexed Mode—The operand offset is the sum of the contents of a base register
(BP or BX) and an index register (DI or SI).
6. Based Indexed Mode with Displacement—The operand offset is the sum of a base
register’s contents, an index register’s contents, and an 8-bit or 16-bit displacement.
Table 1-2
Memory Addressing Mode Examples
Addressing Mode
Example
Direct
mov ax, ds:4
Register Indirect
mov ax, [si]
Based
mov ax, [bx]4
Indexed
mov ax, [si]4
Based Indexed
mov ax, [si][bx]
Based Indexed with Displacement
mov ax, [si][bx]4
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...