MP_Unit_I
MP_Unit_I
MP_Unit_I
Syllabus
Part A:
1. Brief History of Intel Microprocessor
2. 80386DX Features and Architecture
3. Programmers Model
4. Operating Modes
5. Addressing Mode
6. Data Types
Syllabus
Part B: Applications Instruction Set
Prefetch Unit
●The Internal Architecture of 80386 is divided into
3 sections.
General
Pointer
Purpose Register
Register
Segment
Register
●Six Conditional ●Three Control
or status Flags Flags
◦Carry Flag (CF) ◦Interrupt Flag (IF)
◦Parity Flag (PF) ◦Trap Flag (TF)
◦Auxiliary Flag( AF) ◦Direction Flag (DF)
◦Zero Flag (ZF)
◦Sign Flag (SF)
◦Overflow Flag (OF)
●Four System Flags
◦Input/output privilege level
(IOPL)
◦Nested Task (NT)
◦Resume Flag (RF)
◦Virtual Mode Flag (VM)
Control Flags
DF ( Direction flag) : The direction flag controls the direction of string operations.
When the D flag is cleared these operations process strings from low memory up
towards high memory. This means that offset pointers (usually SI and DI) are
incremented by 1 after each operation in the string instructions when D flag is
cleared. If the D flag is set, then SI and DI are decremented by 1 after each
operation to process strings from high to low memory.
IF (Interrupt Flag) : When interrupt flag is set, the 80386 recognizes and handles
external hardware interrupts on its INTR pin. If the interrupt flag is cleared, 80386
ignores any inputs on this pin. The IF flag is set and cleared with the STI and CLI
instructions, respectively.
TF (Trap Flag) : Trap flag allows user to single-step through programs. When an
80386 detects that this flag is set, it executes one instruction and then
automatically generates an internal exception 1. After servicing the exception, the
processor executes the next instruction and repeats the process. This single
stepping continues until program code resets this flag for debugging programs
single step facility is used.
System Flags
NT (Nested flag) : This flag is set when one system task invokes another
task. (i.e. nested task).
IOPL (1/0 Privilege level) : The two bits in the IOPL are used by the
processor and the operating system to determine your application's access
to I/0 facilities. It holds privilege level, from O to 3, at which the current
code is running in order to execute any I/0 related instruction.
●NT (Nested flag) :
◦ This flag is set when one system task invokes another
task.(i.e. nested task).
●IOPL (l/O Privilege level) :
◦ The two bits in the IOPL are used by the processor
and the operating system to determine your
application's access to I/O facilities.
Operating Modes of
80386
Operating Modes of 80386
1. Real Mode:
● In real mode, the processor emulates the behavior of these 8086
processors.
● It has access to only 1 MB of memory.
2. Protected Mode:
● Protected mode is a 32-bit operating mode all instruction and
features are available
● It provides access to a 4 GB address space and supports
multitasking and virtual memory.
● It includes features like privilege levels (Rings 0-3) to control
access to system resources.
3. Virtual 8086 Mode:
● This mode allows running multiple instances of real mode 8086
programs concurrently under protected mode.
● It enables multitasking in a way that is compatible with older 16-
bit software.
Operating Modes of 80386
Real Mode
When the 80386 is turned on for the first time, the Real mode is its
default operating mode.
Software created for the 8086 and 8088 processors will work on the
80386 without needing to be modified because it is fully backward-
compatible with these older CPUs.
The 80386 has a 20-bit address space in Real mode, giving it access to
1MB of memory. The memory is separated into 64K segments, and a
16-bit segment register can be used to access each section.
2. Subtraction instructions SUB, SBB, DEC, AAS, DAS, CMP, and NEG
2. Bit test and modify instructions : BIT, BTS, BTR and BTC
1. Segment-register transfer instructions : MOV SegReg, ... , MOV ... , SegReg, PUSH
SegReg and POP SegReg
2. Control transfers to another executable segment : JMP far, CALL far and RET far 3. Data
pointer instructions : LOS, LES, LFS, LGS and LSS