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