8086
8086
8086
3-1
Overview
Textbook:
J. L. Antonakos, "An Introduction to the Intel Family of Microprocessors," Third Edition, Prentice Hall, 1999
Objectives:
The course will provide knowledge to build and program microprocessor-based systems. Microprocessor architecture Architecture of microprocessor-based systems Programming microprocessor-based systems Future trends
Grading:
Two midterms, one final exam, and homeworks
Microprocessor System Design 3-2
Bus
Memory
Output units
Input units
3-3
MAR PC IR
Control bus
Data bus
3-4
Evolution of Computers
First generation (1939-1954) - vacuum tube Second generation (1954-1959) - transistor Third generation (1959-1971) - IC Fourth generation (1971-present) - microprocessor
3-5
Evolution of Computers
First generation (1939-1954) - vacuum tube
Evolution of Computers
Second generation (1954-1959) - transistor
Evolution of Computers
Third generation (1959-1971) - IC
PDP-8, Digital Equipment Corporation
Thanks to the use of ICs, the DEC PDP-8 is the least expensive general purpose small computer in 1960s
Http://history.acusd.edu/gen/recording/computer1.html http://www.piercefuller.com/collect/pdp8.html
Microprocessor System Design 3-8
Evolution of Computers
Fourth generation (1971-present) - microprocessor
In 1971, Intel developed 4-bit 4004 chip for calculator applications.
ROM/RAM buffer Timing Reset
http://www.intel.com
4004 chip layout
A good review article: The History of The Microprocessor, Bell Labs Technical Journal, Autumn, Microprocessor System Design 1997 3-9
P III
P4
6 5 4 3 2 1 0
MIPS
10000
P4
1000
1000
P4
P II
100
P III
10
1 1974 1979
1982
1985
1989
1993
1997
1999
2000
3-10
...
Keyboard
Monitor Bus
Disk
Other peripherals
...
3-12
Microprocessor
Memory
Interrupt control
Timing
CPU
Memory
Serial I/O
Simple (only two wires + ground) but slow.
Printer (low resolution) Modem Operators console Mainframe Personal computer
Interrupt circuitry
At external unexpected events, QP has to interrupt the main program execution, service the interrupt request (obviously a short subroutine) and retake the main program from the point where it was interrupt.
System ROM
640KB DRAM
System bus (data, address & control signals) Keyboard logic (8253) DMA Controller (8237)
Video card Disk controller Serial port ... Extension slots
Expansion logic
Keyboard
OSC. CPU
RAM
ROM
Class Objectives
Hardware architecture of microprocessor-based systems
Microprocessor architecture Memory organization I/O units of microprocessor-based systems How to put them together
3-17
Overview
Intel 8088 facts
20 bit address bus allow accessing
1 M memory locations
VDD (5V)
20-bit address
8088
yy
yyy
Organization of 8088
Address bus (20 bits) AH BH CH AL BL CL DL SP BP SI DI ALU Data bus (16 bits) Segment register CS DS SS ES IP Data bus (16 bits) General purpose register 7
DH
Bus control ALU EU control Flag register Instruction Queue External bus
AX BX
AH BH CH DH
AL BL CL DL
Data Group
CX DX
SP
BP SI DI
Microprocessor System Design
B
n bits
F 0 0 0 0 1 1 0 0 1 1 0 0
Y 0 A+ B 1 A -B 0 A -1 1 A and B 0 A or B 1 not A y y y
Carry Y= 0 ? A> B ? F
y y y Y
Signal F control which function will be conducted by ALU. Signal F is generated according to the current instruction. Basic arithmetic operations: addition, subtraction, yyyyy Basic logic operations: and, or, xor, shifting,yyyyy
Microprocessor System Design 3-22
Flag Register
Flag register contains information reflecting the current status of a microprocessor. It also contains information which controls the operation of the microprocessor.
15
0 OF DF IF TF SF ZF AF PF CF
Control Flags
IF: DF: TF: Interrupt enable flag Direction flag Trap flag
Status Flags
CF: PF: AF: ZF: SF: OF: Carry flag Parity flag Auxiliary carry flag Zero flag Sign flag Overflow flag
3-23
MOV AL, BL
Some instructions do not have operands, or have only one operand Opcode tells what operation is to be performed. (EU control logic generates ALU control signals according to Opcode) Mode indicates the type of a instruction: Register type, or Memory type Operands tell what data should be used in the operation. Operands can
EU Operation
1. Fetch an instruction from instruction queue 2. According to the instruction, EU control logic generates control signals. (This process is also referred to as instruction
decoding)
AH BH CH DH SP BP SI DI AL BL CL DL General purpose register
EU control
Flag register
instruction 1011000101001010
3-25
16-bit register
Addr1
3-26
Memory Segmentation
A segment is a 64KB block of memory starting from any 16-byte
boundary
For example: 00000, 00010, 00020, 20000, 8CE90, and E0840 are all valid segment addresses The requirement of starting from 16-byte boundary is due to the 4-bit left shifting
CS DS SS ES
8 A B 4 4 2 6 0 2 2
2 3 0 0 DI + Data address 1 2 3
3-28
Fetching Instructions
Where to fetch the next instruction?
8088 CS IP 1234 0012 12352 Memory
12352
MOV AL, 0
Update IP
After an instruction is fetched, Register IP is updated as follows:
3-29
Register indirect addressing: MOV AL, [SI] DS Memory address 1 1 2 3 4 0 0 3 1 0 2 6 5 0 (assume DS=1234H) (assume SI=0310H)
3-30
Locations from FFFF0H to FFFFFH are used for system reset code
FFFF0
Locations from 00000H to 003FFH are used for the interrupt pointer table
It has 256 table entries Each table entry is 4 bytes 256 v 4 = 1024 = memory addressing space From 00000H to 003FFH
003FF 00000
3-31
Interrupts
An interrupt is an event that occurs while the processor is executing a program The interrupt temporarily suspends execution of the program and switch the processor to executing a special routine (interrupt service routine) When the execution of interrupt service routine is complete, the processor resumes the execution of the original program Interrupt classification Hardware Interrupts
Caused by activating the processors interrupt control signals (NMI, INTR)
Software Interrupts
Caused by the execution of an INT instruction Caused by an event which is generated by the execution of a program, such as division by zero
Maximum Mode
It needs 8288 bus controller to generate control signals for memory and I/O operations It allows the use of 8087 coprocessor; it also provides other functions
3-33