Professional Documents
Culture Documents
MP Unit 2 Oneshot
MP Unit 2 Oneshot
MP Unit 2 Oneshot
Hello Friend!
These notes are not free, the fee of these notes is that
you should pray for me.
Please remember me in your prayers
: Dr. Shameem Ahmad
(Sarcastic Teacher)
Micro-Processor
SE-CS
UNIT 2
UNIT-2:
1. Flag Register(PSW)/EFLAGS
• Carry Flag (CF): This flag is set when the carry is generated out of the MSB.
• Parity Flag (PF): This flag is set if the result contains an even number of 1s.
• Auxiliary Carry Flag (AF): This flag is set when carry is transferred from D3bit (lower
nibble to higher nibble) in 8-bit arithmetic operations.
• Zero Flag (ZF): This flag is set if the result of an operation is zero.
• Sign Flag (SF): This flag is set if the result of an operation is negative.
• Trap Flag (TF): This flag is used to enable single-step mode, which allows the processor to
execute one instruction at a time, which is useful for debugging.
• Interrupt Flag (IF): This flag is used to enable or disable maskable interrupts.
• Direction Flag (DF): This flag is used to control the direction of string operations, such as
move and compare.
• Overflow Flag (OF): This flag is set when the result of an arithmetic is out of range.
1
02-03-2024
UNIT-2:
1. Flag Register(PSW)/EFLAGS
2. PIN Diagram
2
02-03-2024
2. PIN Diagram • CLK2 is twice the frequency of the actual system clock.
• RESET: This signal is used to reset the 80386.
• 𝑅𝐸𝐴𝐷𝑌 pin is used to synchronize the µP with slower
peripherals
• If 𝑅𝐸𝐴𝐷𝑌 pin is = 0, that means device is ready and hence
µP continues.
• If 𝑅𝐸𝐴𝐷𝑌 pin is = 1, it means device is not ready hence µP
inserts “Wait States”.
3
02-03-2024
4
02-03-2024
5
02-03-2024
• Programmers model:
• In real mode:
• 6, 16-bit segment registers: CS, SS, DS, ES,
Extras: FS and GS.
• 5, 16-bit offset registers IP,SP,BP,SI,DI.
• Processor State after Reset:
• 4, 16-bit data registers :AX, BX CX and DX
• On reset 80386 goes to ROM location
• lower 12-bits of the Flag Register
FFFF FFF0 h, called the Reset Vector
• Only the LSB of CR0 (PE)is available in
Address of 80386 and executes a BIOS
Real Mode
program (also called Monitor Program).
• 8 addressing modes are available
• Additionally 80386 may also execute a
POST (Power-On Self Test), used to test • In Protected mode.
its internal hardware. • six, 16-bit segment registers.
• The Self Test optional. It is only • five, 32-bit extended offset
executed if the BUSY pin is held low registers(EIP,ESP,EBP,EDI,ESI)
during Reset. • Four, 32-bit general purpose registers
• Self Test takes approx 26 milliseconds. EAX,EBX,ECX,EDX
• 32 bit flag register called EFLAGS (or PSW)
• After the test, the result is stored in
EAX register. If EAX = 00H, then the • Four 32bit control registers:
Self Test was successful, else the test CR0,CR1,CR2,CR3
was unsuccessful. • All memory management registers are
available. 8 debug and 2 test registers are
available.
6
02-03-2024
Thank You
Like Share & Subscribe to
SarcasticTeacher
@ShameemSir