
Programming
2-10
2.7
ADDRESSING MODES
The Am186ES and Am188ES 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
n
Register Operand Mode—The operand is located in one of the 8- or 16-bit registers.
n
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 or explicitly chosen by a segment override prefix. The offset, also
called the effective address, is calculated by summing any combination of the following
three address elements:
1. Displacement—an 8-bit or 16-bit immediate value contained in the instruction
2. Base—contents of either the BX or BP base registers
3. 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 2-3).
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 registers SI, DI, BX, or BP.
3. Based Mode—The operand offset is the sum of an 8- or 16-bit displacement and the
contents of a base register (BX or BP).
4. Indexed Mode—The operand offset is the sum of an 8- or 16-bit displacement and the
contents of an index register (SI or DI).
5. Based Indexed Mode—The operand offset is the sum of the contents of a base register
and an index register.
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 2-3
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
Summary of Contents for Am186 ES
Page 1: ...Am186 ES and Am188 ES User s Manual...
Page 4: ...iv...
Page 12: ...Table of Contents xii...
Page 22: ...Features and Performance 1 8...
Page 60: ...System Overview 3 28...
Page 84: ...Chip Select Unit 5 14...
Page 132: ...Timer Control Unit 8 8...
Page 166: ...Programmable I O Pins 11 6...
Page 184: ...Register Summary A 18...