80C186XL/80C188XL Microprocessor User’s Manual
80C186XL/80C188XL Microprocessor User’s Manual
Intel Corporation
Contents
Contents
Power Management
Setting the PCB Base Location
Clock Generation
LCS
Chapter Refresh Control Unit
Functional Overview Programming the TIMER/COUNTER Unit
Programming the Interrupt Control Unit
Functional Overview
Chapter Math Coprocessing
Chapter Once Mode
Figures
UCS
Reset Configuration
Interrupt Control Register for Noncascadable External Pins
10-9
Tables
Flag Bit Functions
Example
Examples
Introduction
Page
Chapter Introduction
HOW to USE this Manual
Feature 80C186XL 80C186EA 80C186EB 80C186EC
Comparison of 80C186 Modular Core Family Products
Related Documents
Related Documents and Software
Document/Software Title Order No
Electronic Support Systems
FaxBack Service
Bulletin Board System BBS
CompuServe Forums
World Wide Web
Technical Support
Training Classes
Product Literature
Page
Overview 80C186 Family Architecture
Page
Architectural Overview
Chapter Overview of the 80C186 Family Architecture
Execution Unit
Simplified Functional Block Diagram of the 80C186 Family CPU
Physical Address Generation
Bus Interface Unit
General Registers
General Registers
Segment Registers
Implicit Use of General Registers
Operations
Segment Registers
Instruction Pointer
Flags
Memory Segmentation
Register Mnemonic
Register Name
PSW Flags
Register Function
Segment Locations in Physical Memory
Logical Addresses
Fffffh
Data DS Code CS Stack SS Extra ES
2BFH 2BEH 2BDH 2BCH 2BBH 2BAH
Type of Memory Reference Default Alternate Offset
Dynamically Relocatable Code
Logical Address Sources
Before After Relocation Code Segment
Segment Code Data
Segment Data Extra
Reserved Memory and I/O Space
Stack Implementation
10. Stack Operation
Instruction Set
Software Overview
Data Transfer Instructions
General-Purpose
Input/Output
Sahf 7 6 5 4 3 2 1
Lahf S Z U a U P U C
Pushf Popf U U O D I T S Z U a U P U C
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Subtraction
Addition
Multiplication
Division
Bit Manipulation Instructions
Arithmetic Interpretation of 8-Bit Numbers
Hex Bit Pattern Unsigned Signed Unpacked Packed Binary
Shifts
String Instructions
String Instruction Register and Flag Use
Program Transfer Instructions
CX AL/AX
Overview of the 80C186 Family Architecture
Unconditional Transfers
Conditional Transfers
Iteration Control
Interrupts
Mnemonic Condition Tested Jump if…
10. Interpretation of Conditional Transfers
Processor Control Instructions
Addressing Modes
11. Processor Control Instructions
Register and Immediate Operand Addressing Modes
Memory Addressing Modes
BIU
0000 Physical Addr
13. Direct Addressing
Opcode Mod R/M Displacement
15. Based Addressing
14. Register Indirect Addressing
Rate Base Vac
Displacement High Address Rate Age
Base Register
Register Dept Div Employee Age
17. Indexed Addressing
18. Accessing an Array with Indexed Addressing
19. Based Index Addressing
20. Accessing a Stacked Array with Based Index Addressing
Opcode Source EA Destination EA
12. Supported Data Types
Data Types Used in the 80C186 Modular Core Family
Type Description
BCD
23 C186 Modular Core Family Supported Data Types
Interrupt/Exception Processing
Interrupts and Exception Handling
3FC
3FE
Overview of the 80C186 Family Architecture
Stack
Interrupt Enable Bit
PSW
Trap Flag
Exceptions
Maskable Interrupts
Invalid Opcode Type
Interrupt Latency
Software Interrupts
Clocks
Interrupt Response Time
Total
Interrupt and Exception Priority
Execute Divide Service Routine
NMI
Iret
29. Simultaneous NMI and Single Step Interrupts
Trap Flag = ???
30. Simultaneous NMI, Single Step and Maskable Interrupt
Interrupt Enable Bit IE = Trap Flag TF =
Page
Bus Interface Unit
Page
Multiplexed Address and Data BUS
Address and Data BUS Concepts
1 16-Bit Data Bus
MByte KBytes
Physical Implementation Address Space for
Fffff Ffffe Ffffd Ffffc
A190 D70 A191 D158
A191 D158 BHE High
Even Byte Transfer
Odd Byte Transfer
D70 A0 Low A191 D158 BHE High
Bit Data Bus Even Word Transfers
A191 D158 BHE Low D70 A0 Low
A191 D158 BHE Low
First Bus Cycle
Second Bus Cycle
D70 A0 High A191 D158 BHE Low
Bit Data Bus Word Transfers
Memory and I/O Interfaces
1 16-Bit Bus Memory and I/O Requirements
2 8-Bit Bus Memory and I/O Requirements
BUS Cycle Operation
Low Phase High Phase
Phase
Clkout ALE
S20 Valid Status AD150 Address Data
Request Pending
Bus Ready
Hold Deasserted
RES#
Address/Status Phase
Address Status Phase Or TW Or TI Data Phase
Or TI
Clkout
S20
A1916
ALE STB
STB
Wait States
Data Phase
Or TW Or TI
Clkout RD/ WR
AD150 Valid Write Data Read Read Data S20
Ready
Ardy Clkout Srdy
BUS Ready
CS1 CS2 CS3 CS4 ALE Clkout
Clock
16. Generating a Normally Ready Bus Signal
Idle States
Clkout Ardy Srdy
18. Normally Ready System Timings
Read Bus Cycles
BUS Cycles
Read Bus Cycle Types
Read Cycle Critical Timing Parameters
Rfsh
A158
A150
DT/R DEN
AD70 O0-7
UCS
27C256
LA151 AD158
A158 A150
Write Bus Cycle Types
Status Bits Bus Cycle Type
LA0 BHE
LA151
A014 O18 CS1 AD70 AD158
LCS
Write Cycle Critical Timing Parameters
Interrupt Acknowledge Bus Cycle
INTA0 INTA1
Lock DT/R DEN
BHE RD, WR
Processor 82C59A
INTA0 Inta INT0 IR0 IR7 PCS0 LA1
System Design Considerations
Halt Bus Cycle
011 AD150 AD70 A158 A1916
Pins Pin State
Rfsh =
BHE
Clkout Hold Hlda
Temporarily Exiting the Halt Bus State
AD150 AD70 A158 A1916
Control
BHE Rfsh
S20 AD150 AD70 A158 A1916
T3 TI TI TI TI
T4 T1 T2 T3
AD70 A158
RFSH=1
System Design Alternatives
NMI/INTx
Clkout RD,WR DT/R DEN
Buffering the Data Bus
Device
DT/ R
CPU Local Bus Buffered Bus
Buffer Buffered Data Bus AD70
MCS0
Buffer Local Data Bus
Synchronizing Software and Hardware Events
Using a Locked Bus
Queue Status Signal Decoding
Using the Queue Status Signals
Queue Status
No queue operation occurred
Entering Bus Hold
MULTI-MASTER BUS System Designs
Float
Signal Hold Condition
RD, W R Float BHE , S20
Lock
Refresh Operation During a Bus Hold
Clkout Hold Hlda DEN RD, WR
BHE, S20
DT/R Lock
Hlda Reset Hold PRE CLR
Latched Hlda
Exiting Hold
DEN RD, WR, BHE
DT/R, S20 A1916, Lock
BUS Cycle Priorities
BUS Interface Unit
Page
Peripheral Control Block
Page
PCB Relocation Register
Peripheral Control Registers
Bit Bit Name Reset Function Mnemonic State
Register Name PCB Relocation Register Register Mnemonic
Relreg
Peripheral Control Block
Ready Signals and Wait States
Accessing the Peripheral Control Block
Reserved Locations
Bus Cycles
Word reads
Bus Operation
Accessing the Peripheral Control Registers
Setting the PCB Base Location
Accessing Reserved Locations
Writing the PCB Relocation Register
Considerations for the 80C187 Math Coprocessor Interface
Page
Clock Generation Power Management
Page
Clock Generation
RES
Crystal Oscillator
Oscillator Operation
= Inverter Output Z 90˚ 180˚
Crystal Connections to Microprocessor
Values µH
Third-Overtone Crystal Inductor L1
Selecting Crystals
Using an External Oscillator
Reset and Clock Synchronization
Output from the Clock Generator
1µf typical
Typical Ct = V 1 e
Cold Reset Waveform
Clkout
PCS60,NCS
Clkout Reset
Power Management
RES Resync
Entering Power-Save Mode
Power-Save Mode
Enables and sets clock division factor
Power Save Register
Register Name Register Mnemonic Register Function
Pwrsav
Example Power-Save Initialization Code
10. Power-Save Clock Transition Leaving Power-Save Mode
Syntax
Chip-Select Unit
Page
Common Methods for Generating CHIP-SELECTS
CHIP-SELECT Unit Features and Benefits
CHIP-SELECT Unit Functional Overview
Chip-Selects Using Addresses Directly Simple Decoder
27C256
74AC138
MCS2
MCS3
MCS1
PCS1
MCS30, LCS
A1916 UCS, PC S60
Srdy Ardy UCS
1Address
Data Active For Top 1 KByte Memory Map
1MB
Initialization Sequence
Programming
Chip-Select Unit Registers
Control Register Alternate Register
UCS Control Register
Umcs
Controls the operation Chip-select
Lmcs
LCS Control Register
Mmcs
MCS Control Register
Controls the operation Chip-selects
MCS
PCS Control Register
Pacs
PCS
Register NameMCS and PCS Alternate Control Register
Mpcs
X S
UCS Active Range
Programming the Active Ranges
UCS Block Size and Starting Address
Umcs Field Block Size Starting Address U1710
LCS Active Range
LCS Active Range
MCS Active Range
Lmcs Field Block Size Ending Address U1710
Block Size Mmcs Start Address Kbytes Restrictions
MCS Block Size and Start Address Restrictions
PCS Active Range
Bus Wait State and Ready Control
R2 Control Bit Wait Wait State Value R10 State Counter
Wait State Ready
Overlapping Chip-Selects
Programming Considerations
Memory or I/O Bus Cycle Decoding
Example 1 Typical System Configuration
CHIP-SELECTS and BUS Hold
Examples
13. Typical System
MOD186XREF Name CSUEXAMPLE1
Example 6-1. Initializing the Chip-Select Unit
Drambase EQU
Place memory variables here
Refresh Control Unit
Page
CLR REQ
CPU
Role of the Refresh Control Unit
Refresh Control Unit Capabilities
Refresh Control Unit Operation
Refresh Control Unit Operation Flow Chart
Refresh Address Formation
Refresh Addresses
Guidelines for Designing Dram Controllers
Refresh BUS Cycles
Identification of Refresh Bus Cycles
Data Bus Width
T3/TW Clkout
Muxed Row Column Address S20
RAS CAS
Programming the Refresh Control Unit
Calculating the Refresh Interval
Refresh Control Unit Registers
Rfbase
Register NameRefresh Base Address Register
Register FunctionDetermines upper 7 bits of refresh address
Refresh Base Address Register
Register Function Sets refresh rate
Rftime
Rfcon
Refresh Control Register
Controls Refresh Unit operation
Programming Example
Example 7-1. Initializing the Refresh Control Unit
Refresh Operation and BUS Hold
RD, WR BHE, S2 DT / R A1916
Clkout Hold Hlda DEN
Page
Interrupt Control Unit
Page
Functional Overview
Chapter Interrupt Control Unit
Timer 0 Timer 1 Timer
Master Mode
Generic Functions in Master Mode
DMA
Interrupt Masking
Default Interrupt Priorities
Interrupt Priority
Interrupt Name Relative Priority
Interrupt Nesting
Functional Operation in Master Mode
Priority Resolution
Typical Interrupt Sequence
Priority Resolution Example
Interrupts That Share a Single Source
Cascading with External 8259As
Inta INTA0
INT INT0
INT INT1
Inta INTA1
Polling
Interrupt Acknowledge Sequence
Fixed Interrupt Types
Interrupt Name Interrupt Type
Additional Latency and Response Time
Edge and Level Triggering
Inta Idle Read IP
Inta Idle
Read CS Idle Push Flags Push CS Push IP
Programming the Interrupt Control Unit
Interrupt Control Registers
2CH
2AH
MSK
Interrupt Control Register for Internal Sources
Register NameInterrupt Control Register non-cascadable pins
I2CON, I3CON
LVL
I0CON, I1CON
Register NameInterrupt Control Register cascadable pins
Sfnm
CAS
Register Name Interrupt Request Register Register Mnemonic
Interrupt Request Register
Reqst
Register Function Stores pending interrupt requests
Imask
Register Name Interrupt Mask Register Register Mnemonic
Register Function Masks individual interrupt sources
Priority Mask Register
Priority Mask Register
In-Service Register
Primsk
Masks lower-priority interrupt sources
Inserv
In-Service Register
Indicates which interrupt handlers are in process
Poll and Poll Status Registers
Poll Register
Poll
Ireq
Poll Status Register
Read to check for pending interrupts when polling
Pollsts
End-of-Interrupt EOI Register
End-of-Interrupt Register
Used to issue an EOI command
EOI
Interrupt Status Register
Interrupt Status Register
Slave Mode
Intsts
Dhlt
IRQ INT VCC
INT0 Inta
16. Interrupt Sources in Slave Mode
Slave Mode Programming
Master Mode Slave Mode PCB Offset Register Name
Slave Mode Fixed Interrupt Type Bits
Interrupt Vector Register
Interrupt Control Unit Register Comparison
Intvec
Register NameInterrupt Vector Register Slave Mode only
Used to issue the EOI command
End-of-Interrupt Register in Slave Mode
T1 T2 T3 T4
Interrupt Vectoring in Slave Mode
Inta INTA0 Select Lock
CAS20 Slave Cascade Address From 8259A
Inta Idle Read IP Read CS Push Flags Push CS Push IP
Initializing the Interrupt Control Unit for Master Mode
Priorities are used
Page
Timer/Counter Unit
Page
Chapter TIMER/COUNTER Unit
Interrupt Latch Clock
Timer Element Registers Output Latch
T0IN T1IN T0OUT T1OUT
Counter Element Multiplexing and Timer Input Synchronization
Timers 0 and 1 Flow Chart
From
Timer/Counter Unit Output Modes
Programming the TIMER/COUNTER Unit
Timer 0 and 1 Control Registers
Defines Timer 0 and 1 operation
T0CON, T1CON
EXT
RTG
ALT
Cont
Defines Timer 2 operation
Timer 2 Control Register
T2CON
Maximum count. The MC bit must be cleared
Register Function Contains the current timer count
Register Name Timer Count Register Register Mnemonic
T0CNT, T1CNT, T2CNT
C C
Timer Maxcount Compare Registers
Clock Sources
Timer 0 and 1 Clock Sources
Counting Modes
Clock Source
Retriggering
Timer Retriggering
Timer Operation
Pulsed and Variable Duty Cycle Output
Enabling/Disabling Counters
Timer Serviced Internal Count Value Maxcount TxOUT Pin
Timer Interrupts
Input Setup and Hold Timings
Timing
Synchronization and Maximum Frequency
Timer/Counter Unit Application Examples
Real-Time Clock
Square-Wave Generator
Intsts
Example 9-1. Configuring a Real-Time Clock
Out Dx, al
Timer2interruptroutine proc far
T1CON
Example 9-2. Configuring a Square-Wave Generator
Example 9-3. Configuring a Digital One-Shot
Cmpb
Page
Direct Memory Access Unit
Page
DMA Transfer
Chapter Direct Memory Access Unit
Typical DMA Transfer
Fetch Deposit
DMA Requests
Source and Destination Pointers
DMA Transfer Directions
Byte and Word Transfers
T1 or T2 or T3 or TW or T4 or
External Requests
Cycle
DRQ
Source Synchronization
DRQ Case
Fetch Cycle Deposit Cycle T1 T2 T3 T4 T1 T2 T3 T4 TI TI
Timer 2-Initiated Transfers
Clkout DRQ
Case
Termination and Suspension of DMA Transfers
DMA Transfer Counts
DMA Cycles and the BIU
DMA Unit Interrupts
Two-Channel DMA Unit
DMA Channel Arbitration
Two-Channel DMA Module
Module
SRC
Programming the DMA Unit
DMA Channel Parameters
Register NameDMA Source Address Pointer High
Register Mnemonic DxSRCH
DMA Xxxxh
Register NameDMA Source Address Pointer Low
Register Mnemonic DxSRCL
S S a a
Register NameDMA Destination Address Pointer High
DxDSTH
Contains the upper 4 bits of the DMA Destination pointer
Register Mnemonic DxDSTL
Register NameDMA Destination Address Pointer Low
Dmem
D I E N C C C N T
Ddec
Dinc
Idrq
Synchronization Type
CHG
Strt
Word
Arming the DMA Channel
Selecting Channel Synchronization
Programming the Transfer Count Options
Generating Interrupts on Terminal Count
Setting the Relative Priority of a Channel
Initializing the DMA Unit
Suspension of DMA Transfers
Hardware Considerations and the DMA Unit
DRQ Pin Timing Requirements
DMA Transfer Rates
DMA Latency
DMA Unit Examples
Generating a DMA Acknowledge
MOV DS, AX Assume Dsdataseg
Example 10-1. Initializing the DMA Unit
10-24
10-25
Example 10-2. Timed DMA Transfers
10-27
Page
Math Coprocessing
Page
Availability of Math Coprocessing
Overview of Math Coprocessing
11.3.1 80C187 Instruction Set
80C187 Math Coprocessor
Real Transfers
C187 Data Transfer Instructions
Integer Transfers
Packed Decimal Transfers
Other Operations
C187 Arithmetic Instructions
C187 Comparison Instructions
Comparison Instructions
Transcendental Instructions
C187 Transcendental Instructions
C187 Constant Instructions
Constant Instructions
C187 Processor Control Instructions
Fldz FLD1 Fldpi FLDL2T FLDL2E FLDLG2 FLDLN2
Microprocessor and Coprocessor Operation
11.3.2 80C187 Data Types
C187-Supported Data Types
80C187
Modular Core
80C186
Clocking the 80C187
Processor Bus Cycles Accessing the 80C187
C187 I/O Port Assignments
Address Read Definition Write Definition
System Design Tips
C187 Configuration with a Partially Buffered Bus
Example Math Coprocessor Routines
Exception Trapping
C187 Exception Trapping via Processor Interrupt Pin
80C186 Modular Core
Name Example80C187init
Results
Example 11-2. Floating Point Math Routine Using Fsincos
Once Mode
Page
ENTERING/LEAVING Once Mode
Chapter Once Mode
Oscout
RES UCS LCS
80C186 Instruction Set Additions Extensions
Page
Data Transfer Instructions
80C186 Instruction SET Additions
High-Level Instructions
String Instructions
Figure A-1. Formal Definition of Enter
Figure A-2. Variable Access in Nested Procedures
Figure A-4. Stack Frame for Procedure a at Level
BPM BPA BPB
Leave
80C186 Instruction SET Enhancements
Bound register, address
Arithmetic Instructions
Bit Manipulation Instructions
Shift Instructions
Rotate Instructions
ROL destination, count
Input Synchronization
Page
Figure B-1. Input Synchronization Circuit
WHY Synchronizers are Required
Asynchronous Pins
Instruction Set Descriptions
Page
Variable Description
Table C-1. Instruction Format Variables
Operand Description
Table C-2. Instruction Operands
Table C-3. Flag Bit Functions
Table C-4. Instruction Set
AAS
Ascii Adjust for Subtraction
ADC
Add with Carry
ADD dest, src
ADD
Logical
Dest, src
Call procedure-name
Call Procedure
Bound
Detect Value Out of Range
Convert Byte to Word
Clear Carry flag
Clear Direction flag
Complement Carry Flag
Clear Interrupt-enable Flag
Compare
CMP
CMP dest, src
Compare String
Decimal Adjust for Addition
Decimal Adjust for Subtraction
Convert Word to Doubleword
Decrement
DEC
When Source Operand is a Word
Divide When Source Operand is a Byte
Procedure Entry
Enter locals, levels
Escape
Halt
Integer Divide When Source Operand is a Byte
Input Byte or Word When Source Operand is a Byte
Integer Multiply When Source Operand is a Byte
Imul
Accum, port
Increment
INC
String
INS dest-string, port
INT interrupt-type
Interrupt
Interrupt Return
Interrupt on Overflow
Jump on Above
Jump on Not Below or Equal
Jump on Not Below
Jump on Above or Equal
Jump on Below
Jump on Not Above or Equal
Jump on Equal Jump on Zero
Jump if CX Zero
Jump on Greater Than
Jump on Not Less Than or Equal
Jump on Not Greater Than or Equal
Name Description Operation Flags Affected Jump on Less Than
Jump on Less Than or Equal
Jump on Not Greater Than
Jump on Not Zero
Jump on Not Equal
Jump on Not Overflow
Jump on Not Sign
Jump on Parity
Name Description Operation Flags Affected Jump on Overflow
Jump on Parity Equal
Instruction Format
LDS dest, src
Load Pointer Using DS
Load Effective Address
LEA dest, src
Load Pointer Using ES
LES dest, src
Lock the Bus
Lods src-string
Load String Byte or Word When Source Operand is a Byte
Loop
Loop While Equal
Loop While Not Zero
Loop While Not Equal
Move Byte or Word
MOV dest, src
Move String
Multiply When Source Operand is a Byte
Movs dest-string, src-string
MUL
Negate When Source Operand is a Byte
Logical Not When Source Operand is a Byte
NEG
Or dest,src
Name Description Operation Flags Affected Logical or
Output
OUT port, accumulator
Out String
Outs port, srcstring
Pop
Pop All
Pop Flags
Push
Push Flags
Push All
RCL dest, count
Rotate Through Carry Left
Rotate Through Carry Right
RCR dest, count
Repeat While Equal
Repeat
Repeat While Zero
Repeat While Not Equal
Return
RET
RET optional-pop-value
Rotate Left
Rotate Right
ROR dest, count
Store Register AH Into Flags
Shift Logical Left
Shift Arithmetic Left
Shift Arithmetic Right
SBB
Subtract With Borrow
SBB dest, src
Scas dest-string
Scan String When Source Operand is a Byte
SHR dest, src
Shift Logical Right
Set Carry Flag
Set Direction Flag
Set Interrupt-enable Flag
Store Byte or Word String When Source Operand is a Byte
Stos dest-string
Subtract
SUB
SUB dest, src
Test
Wait
Exchange
Xchg dest, src
Xlat translate-table
Translate
Exclusive Or
XOR dest, src
Page
Instruction Set Opcodes and Clock Cycles
Page
EA Calculation
Table D-1. Operand Variables
Mod Effect on EA Calculation
Reg Bit w=1 Bit w=0
Function Format Clocks
Table D-2. Instruction Set Summary
Arithmetic Instructions
Arithmetic Instructions
BIT Manipulation Instructions
String Manipulation Instructions
JB/JNAE =
LOOPNZ/LOOPNE =
Processor Control Instructions
Table D-3. Machine Instruction Decoding Guide
Instruction SET Opcodes and Clock Cycles
Instruction SET Opcodes and Clock Cycles
Instruction SET Opcodes and Clock Cycles
Instruction SET Opcodes and Clock Cycles
AX,CX
Instruction SET Opcodes and Clock Cycles
Instruction SET Opcodes and Clock Cycles
Instruction SET Opcodes and Clock Cycles
AL,DX
Instruction SET Opcodes and Clock Cycles
Table D-4. Mnemonic Encoding Matrix Left Half
Table D-4. Mnemonic Encoding Matrix Right Half
Abbr Definition
Table D-5. Abbreviations for Mnemonic Encoding Matrix
Index
Page
Index
Index-2
Index-3
Index-4
Index-5
Index-6
Index-7
Index-8