Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
INTERFACING (EEE342)
Dr. Omer Chughtai
SYSTEM BUS
2
EXECUTION UNIT BUS INTERFACE UNIT
(EU) (BIU)
ARCHITECTURE OF ---16--- ---16---
8088/8086 AH AL AX
BX
CS
DS
CX
DX ES
SI SS
DI
SP IP
BP
ADDRESS
MULTIPLEXED
GENERATION AND
BUS CONTROL BUS
Segment Registers
Arithmetic logic unit (ALU) OPERANDS
INSTRUCTION
Instruction
Status Pointersflags
and Control
QUEUE
Address generation
General-purpose adder
registers
Bus control logic
Temporary-operand registers ALU 6 Bytes (8086)
4 Bytes (8088)
Instruction queue
Permits the 8088 to
---8---
prefetch up to 4 bytes
and 6 bytes (for 8086) FLAGS
3
8088/8086 Memory Space
SOFTWARE MODEL OF MPU
External Memory
00000 16
SR
4 16
FFFFF
8086/8088 MICROPROCESSOR
32-bit Processor
Flag
• Used to interpret status of Assembly Language Instructions
Registers
6
PROGRAM SEGMENTS
ES
7
STATUS REGISTER – FLAGS REGISTER
Status
Reflects the results of an instruction executed by the processor
Control
Enable or disable certain operations of the processor
For example: if the IF (interrupt flag) is cleared (set to 0), inputs from the keyboard
are ignored by the processor
Control Flags Status Flags
TF DF IF OF SF ZF AF PF CF
Carry Flag
15 0
OFFSET VALUE
Logical Address
15 15 0 0
SEGMENTSEGMENT
REGISTERREGISTER
0000
Adder
19 0
20-bit Physical Memory Address Physical Address
9
GENERATING PHYSICAL MEMORY ADDRESS
10
GENERATING PHYSICAL MEMORY ADDRESS
What would be the offset required to map to
Segment base value = 123416 physical address location 002C316 if the contents of
the corresponding segment register are 002A16
Offset value = 002216
123416 = 00010010001101002
0 0 2 2
15 0
1 2 3 6 2 Physical address
19 0
To memory
11
When a call instruction is executed, the
8088 automatically pushes the current
STACK values in CS and IP onto the stack.
PUSH AX
PUSH DI
PUSH DX
15
STACK-POPPING
Pop CX
Pop DX
Pop BX
16
STACK: PUSH, POP
17
EXAMPLE
18
POP AX
AX
POP BX 12 34
Bottom of Stack
1060 22 33 1060 22 33 1060 22 33
105E 44 55 105E 44 55 105E 44 55
105C 66 77 66 77
105C 66 77 105C
TOS
105A 88 99 88 99
105A 88 99 105A
1058 AA BB AA BB
TOS
1058 AA BB 1058
1056 01 23 1056 34 12
1056 01
34 23
12
Not presently
on the stack
1054 45 67 1054 45 67
1054 45 67
1052 89 AB 1052 89 AB
1052 89 AB
1050 CD EF 1050 CD EF
1050 CD EF
01 05 SS 01 05 SS 01 05 SS
00 08 SP 00 06 SP 00 06 SP
19
GENERATING PHYSICAL MEMORY ADDRESS
For Instruction acquisition
Source of segment base value is always the code segment (CS) register
Source of offset value is always the instruction pointer (IP)
The physical address CS:IP
For writing data in to memory during execution phase
Segment base value is specified by the Data Segment (DS) register
The offset value by the destination index (DI)
The physical address DS:DI
To push the parameters on the stack
SS:SP
20
PHYSICAL ADDRESS
8088/8086 Address Memory Instruction
MPU content
CS
0100
DS
SS
Before Fetch After Fetch
ES
15
XX AX
BX
Physical Address (PA) = SBA : EA
CX = Segment Base : Base + Index + Displacement
DX
SP CS
PA = SS : BX + SI + 8-bit displacement
BP
DS BP DI 16-bit displacement
SI ES
DI
EA = Base + index + Displacement
EA can be specified in the instruction
21
MOV CX, [1234h]
PHYSICAL ADDRESS
Move the contents of memory location with
8088/8086 Address Memory Instruction offset 1234h in CX
MPU content
SI
DI
22
PHYSICAL ADDRESS CS
SS
BX
BP
PA = :
DS SI
ES DI
MOV AX, [SI]
PA = 0200016 + 123416
= 0323416
PHYSICAL ADDRESS