
Programming
1-5
1.4
I/O SPACE
The I/O space consists of 64K 8-bit or 32K 16-bit ports. The IN and OUT instructions address
the I/O space with either an 8-bit port address specified in the instruction, or a 16-bit port
address in the DX register. 8-bit port addresses are zero-extended so that A15–A8 are
Low. I/O port addresses 00F8h through 00FFh are reserved. The Am186 and Am188
microcontrollers provide specific instructions for addressing I/O space.
1.5
SEGMENTS
The Am186 and Am188 microcontrollers use four segment registers:
1. Data Segment (DS): The processor assumes that all accesses to the program’s
variables are from the 64K space pointed to by the DS register. The data segment holds
data, operands, etc.
2. Code Segment (CS): This 64K space is the default location for all instructions. All code
must be executed from the code segment.
3. Stack Segment (SS): The processor uses the SS register to perform operations that
involve the stack, such as pushes and pops. The stack segment is used for temporary
space.
4. Extra Segment (ES): Usually this segment is used for large string operations and for
large data structures. Certain string instructions assume the extra segment as the
segment portion of the address. The extra segment is also used (by using segment
override) as a spare data segment.
When a segment register is not specified for a data movement instruction, it’s assumed to
be a data segment. An instruction prefix can be used to override the segment register (see
"Segment Override Prefix" on page 2-2).For speed and compact instruction encoding, the
segment register used for physical-address generation is implied by the addressing mode
used (see Table 1-1).
Table 1-1
Segment Register Selection Rules
1.6
DATA TYPES
The Am186 and Am188 microcontrollers directly support the following data types:
n
Integer—A signed binary numeric value contained in an 8-bit byte or a 16-bit word. All
operations assume a two’s complement representation.
n
Ordinal—An unsigned binary numeric value contained in an 8-bit byte or a 16-bit word.
n
Double Word—A signed binary numeric value contained in two sequential 16-bit
addresses, or in a DX::AX register pair.
n
Quad Word—A signed binary numeric value contained in four sequential 16-bit
addresses.
n
BCD—An unpacked byte representation of the decimal digits 0–9.
Memory Reference Needed
Segment Register Used
Implicit Segment Selection Rule
Local Data
Data (DS)
All data references
Instructions
Code (CS)
Instructions (including immediate data)
Stack
Stack (SS)
All stack pushes and pops
Any memory references that use the BP register
External Data (Global)
Extra (ES)
All string instruction references that use the DI register as an index
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...