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
Programming the Interrupt Control Unit
Functional Overview Programming the TIMER/COUNTER 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
Feature 80C186XL 80C186EA 80C186EB 80C186EC
HOW to USE this Manual
Comparison of 80C186 Modular Core Family Products
Related Documents and Software
Related Documents
Document/Software Title Order No
Electronic Support Systems
FaxBack Service
Bulletin Board System BBS
World Wide Web
CompuServe Forums
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
Implicit Use of General Registers
Segment Registers
Operations
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
Dynamically Relocatable Code
Type of Memory Reference Default Alternate Offset
Logical Address Sources
Segment Code Data
Before After Relocation Code Segment
Segment Data Extra
Reserved Memory and I/O Space
Stack Implementation
10. Stack Operation
Instruction Set
Software Overview
General-Purpose
Data Transfer Instructions
Input/Output
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
Program Transfer Instructions
String Instruction Register and Flag Use
CX AL/AX
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
NMI
Execute Divide Service Routine
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
Address and Data BUS Concepts
Multiplexed Address and Data BUS
1 16-Bit Data Bus
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
2 8-Bit Bus Memory and I/O Requirements
1 16-Bit Bus Memory and I/O Requirements
BUS Cycle Operation
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
Clkout RD/ WR
Or TW Or TI
AD150 Valid Write Data Read Read Data S20
Ardy Clkout Srdy
Ready
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 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
Write Bus Cycle Types
A158 A150
Status Bits Bus Cycle Type
LCS
LA151
LA0 BHE
A014 O18 CS1 AD70 AD158
Write Cycle Critical Timing Parameters
Interrupt Acknowledge Bus Cycle
Lock DT/R DEN
INTA0 INTA1
BHE RD, WR
INTA0 Inta INT0 IR0 IR7 PCS0 LA1
Processor 82C59A
System Design Considerations
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
DT/ R
Device
CPU Local Bus Buffered Bus
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
BHE, S20
Clkout Hold Hlda DEN RD, WR
DT/R Lock
Latched Hlda
Hlda Reset Hold PRE CLR
Exiting Hold
DT/R, S20 A1916, Lock
DEN RD, WR, BHE
BUS Cycle Priorities
BUS Interface Unit
Page
Peripheral Control Block
Page
PCB Relocation Register
Peripheral Control Registers
Register Name PCB Relocation Register Register Mnemonic
Bit Bit Name Reset Function Mnemonic State
Relreg
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
RES
Clock Generation
Crystal Oscillator
Oscillator Operation
= Inverter Output Z 90˚ 180˚
Crystal Connections to Microprocessor
Values µH
Third-Overtone Crystal Inductor L1
Selecting Crystals
Reset and Clock Synchronization
Using an External Oscillator
Output from the Clock Generator
1µf typical
Typical Ct = V 1 e
Cold Reset Waveform
Clkout
PCS60,NCS
Power Management
Clkout Reset
RES Resync
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
Umcs
UCS Control Register
Controls the operation Chip-select
Lmcs
LCS Control Register
MCS
MCS Control Register
Mmcs
Controls the operation Chip-selects
Pacs
PCS Control Register
PCS
Mpcs
Register NameMCS and PCS Alternate Control Register
X S
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
Wait State Ready
R2 Control Bit Wait Wait State Value R10 State Counter
Overlapping Chip-Selects
Programming Considerations
Memory or I/O Bus Cycle Decoding
CHIP-SELECTS and BUS Hold
Example 1 Typical System Configuration
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
Refresh Control Unit Capabilities
Role of the Refresh Control Unit
Refresh Control Unit Operation
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
Muxed Row Column Address S20
T3/TW Clkout
RAS CAS
Calculating the Refresh Interval
Programming the Refresh Control Unit
Refresh Control Unit Registers
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
Priority Resolution
Functional Operation in Master Mode
Typical Interrupt Sequence
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
2CH
Interrupt Control Registers
2AH
MSK
Interrupt Control Register for Internal Sources
I2CON, I3CON
Register NameInterrupt Control Register non-cascadable pins
LVL
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
Poll
Poll Register
Ireq
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
Defines Timer 0 and 1 operation
Timer 0 and 1 Control Registers
T0CON, T1CON
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
Timer Operation
Timer Retriggering
Pulsed and Variable Duty Cycle Output
Enabling/Disabling Counters
Timer Serviced Internal Count Value Maxcount TxOUT Pin
Input Setup and Hold Timings
Timer Interrupts
Timing
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
Programming the DMA Unit
SRC
DMA Channel Parameters
Register Mnemonic DxSRCH
Register NameDMA Source Address Pointer High
DMA Xxxxh
Register Mnemonic DxSRCL
Register NameDMA Source Address Pointer Low
S S a a
DxDSTH
Register NameDMA Destination Address Pointer High
Contains the upper 4 bits of the DMA Destination pointer
Register Mnemonic DxDSTL
Register NameDMA Destination Address Pointer Low
Dinc
D I E N C C C N T
Dmem
Ddec
Idrq
Synchronization Type
Strt
CHG
Word
Selecting Channel Synchronization
Arming the DMA Channel
Programming the Transfer Count Options
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
Modular Core
80C187
80C186
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
Bit Manipulation Instructions
Arithmetic 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
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 Carry flag
Convert Byte to Word
Clear Direction flag
Complement Carry Flag
Clear Interrupt-enable Flag
Compare String
CMP
Compare
CMP dest, src
Decimal Adjust for Subtraction
Decimal Adjust for Addition
Convert Word to Doubleword
Decrement
DEC
When Source Operand is a Word
Divide When Source Operand is a Byte
Enter locals, levels
Procedure Entry
Escape
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
LES dest, src
Load Pointer Using ES
Lock the Bus
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
Logical Not When Source Operand is a Byte
Negate When Source Operand is a Byte
NEG
OUT port, accumulator
Name Description Operation Flags Affected Logical or
Or dest,src
Output
Outs port, srcstring
Out String
Pop
Pop Flags
Pop All
Push
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
ROR dest, count
Rotate Right
Store Register AH Into Flags
Shift Arithmetic Left
Shift Logical Left
Shift Arithmetic Right
Subtract With Borrow
SBB
SBB dest, src
Scas dest-string
Scan String When Source Operand is a Byte
Set Direction Flag
Shift Logical Right
SHR dest, src
Set Carry Flag
Store Byte or Word String When Source Operand is a Byte
Set Interrupt-enable Flag
Stos dest-string
Test
SUB
Subtract
SUB dest, src
Exchange
Wait
Xchg dest, src
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