Module 1 MP PPT
Module 1 MP PPT
T-State:
— One clock period is referred to as a T-State
T-State
— An operation takes an integer number of T-States
T1 T2 T3 T4
TE/EXTC/V/MPI 9
Wait and Idle States
• Idle State
– No bus activity required
– Each is 1 clock period long
– Occurs when instruction queue is full or the MPU does
not need to read/write to memory
• Wait State
– Triggered by events external to MPU
– Buffer full will trigger a wait state
– Triggered by READY pin
– Inserted between T3 and T4
TE/EXTC/V/MPI 10
Memory Segmentation
.
Physical Address
Base Address
Offset
Effective Address
Use of segment
registers, and
pointers TE/EXTC/V/MPI 16
Stack Addressing
TE/EXTC/V/MPI 19
Difference : Min and Max mode
TE/EXTC/V/MPI 20
Minimum Mode Interface
TE/EXTC/V/MPI 21
8086 Minimum-Mode Signals
Power supply
Vcc GND
Interrupt _____
interface TEST ALE
____
BHE/S7
NMI
8086 MPU M/IO’
RESET DT/R’
Memory/IO
___
controls
RD
HOLD ___
DMA WR
interface HLDA ____
DEN
READY
Mode
Select MN/MX’
CLK
TE/EXTC/V/MPI 22
System Clock Generator-8284
TE/EXTC/V/MPI 23
8086 Minimum-Mode
TE/EXTC/V/MPI 24
Read/Write Cycle Timing Diagram for Minimum Mode
T1 T2 T3 TW T4 T1
ALE
BHE S7 – S3
ADD / STATUS A19 – A16
WR
DEN
DT / R
TE/EXTC/V/MPI 25
TE/EXTC/V/MPI 26
T1 T2 T3 TW T4
CLK
M/IO
ALE
MEMORY ACCESS TIME
ADDR/ RESERVED FOR VALID
A15-A0
DATA DATA D15-D0
ADDR/
A19-A16
STATUS
RD/INTA
READY
DT/R
DEN
TE/EXTC/V/MPI 27
T1 T2 T3 TW T4
CLK
M/IO
ALE
ADDR/
A15-A0 DATA OUT (D15-D0)
DATA
ADDR/
A19-A16
STATUS
WR
READY
DT/R
DEN
TE/EXTC/V/MPI 28
8086
Microprocessor Pins and Signals Min/ Max Pins
29
8086
Microprocessor Pins and SignalsMinimum mode signals
30
8086
Microprocessor Pins and SignalsMinimum mode signals
31
8086
Microprocessor Pins and SignalsMaximum mode signals
32
8086
Microprocessor Pins and SignalsMaximum mode signals
33
8086
Microprocessor Pins and SignalsMaximum mode signals
34
Maximum Mode Interface
When the 8086 is set for the maximum-mode configuration, it provides
signals for implementing a multiprocessor / coprocessor system
environment.
They are called as global resources. There are also other resources that
are assigned to specific processors. These are known as local or private
resources.
TE/EXTC/V/MPI 35
Bus Controller - 8288
TE/EXTC/V/MPI 36
TE/EXTC/V/MPI 37
8086 Maximum Mode System
TE/EXTC/V/MPI 38
TE/EXTC/V/MPI 39
Memory Read Timing in Maximum mode.
ALE
S2 – S 0 Inactive
Active Active
Add/Status BHE, A 19 – A 16 S7 – S3
Add/Data A 15 – A 0 D 15 – D 0
MRDC
DT / R
DEN
TE/EXTC/V/MPI 40
Memory Write Timing in Maximum mode.
Clk
ALE
ADD/STATUS BHE S7 – S3
DT / R high
DEN
TE/EXTC/V/MPI 41
Assembler directives
8086
Microprocessor Assemble Directives
Control the generation of machine codes and organization of the program; but no
machine codes are generated for assembler directives.
Used to :
› specify the start and end of a program
› attach value to variables
› allocate storage locations to input/ output data
› define start and end of segments, procedures, macros etc..
43
8086
Microprocessor Assemble Directives
DB Define Byte
ASSUME Range : 00H – FFH for unsigned value; 00H – 7FH for
positive value and 80H – FFH for negative value
ORG
END
EVEN General form : variable DB value/ values
EQU
PROC
FAR Example:
NEAR LIST DB 7FH, 42H, 35H
ENDP
Three consecutive memory locations are reserved for
SHORT the variable LIST and each data specified in the
instruction are stored as initial value in the reserved
MACRO memory location
ENDM 44
8086
Microprocessor Assemble Directives
DB Define Word
PROC
FAR Example:
NEAR ALIST DW 6512H, 0F251H, 0CDE2H
ENDP
Six consecutive memory locations are reserved for
SHORT the variable ALIST and each 16-bit data specified in
the instruction is stored in two consecutive memory
MACRO location.
ENDM 45
8086
Microprocessor Assemble Directives
ORG
END Segnam SEGMENT
EVEN …
… Program code
EQU … or
… Data Defining Statements
…
PROC …
FAR
Segnam ENDS
NEAR
ENDP
SHORT
ORG
User defined name of the
END Segment Register
segment
EVEN
EQU
PROC Example:
FAR
NEAR ASSUME CS: ACODE, DS:ADATA Tells the compiler that the instructions of the
program are stored in the segment ACODE and
ENDP data are stored in the segment ADATA
SHORT
MACRO
ENDM 47
8086
Microprocessor Assemble Directives
ORG (Origin) is used to assign the starting address
DB
(Effective address) for a program/ data segment
PROC
FAR LOOP EQU 10FEH Value of variable LOOP is 10FE H
NEAR
ENDP
_SDATA SEGMENT In this data segment, effective address of memory location
ORG 1200H assigned to A will be 1200 H and that of B will be 1202 H and
SHORT A DB 4CH 1203H.
EVEN
B DW 1052H
MACRO _SDATA ENDS
ENDM 48
8086
Microprocessor Assemble Directives
PROC Indicates the beginning of a procedure
DB
ENDP End of procedure
DW
FAR Intersegment call
SEGMENT
ENDS NEAR Intrasegment call
General form
ASSUME
DB
Examples:
DW
SEGMENT ADD64 PROC NEAR The subroutine/ procedure named ADD64 is declared as
NEAR and so the assembler will code the CALL and RET
ENDS … instructions involved in this procedure as near call and
… return
…
ASSUME
RET
ADD64 ENDP
ORG
END
EVEN
EQU CONVERT PROC FAR The subroutine/ procedure named CONVERT is declared as
FAR and so the assembler will code the CALL and RET
… instructions involved in this procedure as far call and return
…
PROC …
ENDP
RET
FAR CONVERT ENDP
NEAR
SHORT
MACRO
ENDM 50
8086
Microprocessor Assemble Directives
ASSUME JMP SHORT AHEAD The directive will reserve one memory location
for 8-bit displacement named AHEAD
ORG
END
EVEN
EQU
PROC
ENDP
FAR
NEAR
SHORT
MACRO
ENDM 51
8086
Microprocessor Assemble Directives
PROC
ENDP
FAR
NEAR User defined name of the macro
SHORT
MACRO
ENDM 52
To write an assembly language program to perform division of
16-bit unsigned number by 8-bit unsigned number.
.MODEL SMALL
DATA SEGMENT
OPR1 DW 2C58H
OPR2 DB 56H
RESQ DB ?
RESR DB ?
DATA ENDS