SlideShare a Scribd company logo
1 of 30
Download to read offline
UNIT 6 – Assembly
Language Programming
-By
Prof. K. U. Sharma
Introduction
• An interrupt is an event which informs the CPU that its
service (action) is needed.
• Sources of interrupts:
– internal fault (e.g.. divide by zero, overflow)
– software
– external hardware :
• maskable
• nonmaskable
– reset
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Interrupt Terminologies
• Interrupt pins: Set of pins used in hardware interrupts
• Interrupt Service Routine (ISR) or Interrupt handler: code used for
handling a specific interrupt
• Interrupt priority: In systems with more than one interrupt inputs,
some interrupts have a higher priority than other
– They are serviced first if multiple interrupts are triggered
simultaneously
• Interrupt vector: Code loaded on the bus by the interrupting device that
contains the Address (segment and offset) of specific interrupt service
routine
• Interrupt Masking: Ignoring (disabling) an interrupt
• Non-Maskable Interrupt: Interrupt that cannot be ignored (power-
down)
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Interrupt Vectors
• The processor uses the interrupt vector to determine the address of the ISR of
the interrupting device.
• In the 8088/8086 processor as well as in the 80386/80486/Pentium processors
operating in Real Mode (16-bit operation), the interrupt vector is a pointer to
the Interrupt Vector Table.
– The Interrupt Vector Table occupies the address range from 00000H to
003FFH (the first 1024 bytes in the memory map).
– Each entry in the Interrupt Vector Table is 4 bytes long:
• The first two represent the offset address and the last two the segment
address of the ISR.
– The first 5 vectors are reserved by Intel to be used by the processor.
• The vectors 5 to 255 are free to be used by the user.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Basic Procedure for Processing Interrupts
• When an interrupt is executed, the mp:
– finishes executing its current instruction (if any).
– saves (PUSH) the flag register, IP and CS register in the stack.
– goes to a fixed memory location.
– reads the address of the associated ISR.
– Jumps to that address and executes the ISR.
– gets (PULL) the flag register, CS:IP register from the stack.
– continues executing the previous job (if any).
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
8088/86 Hardware Interrupts pins
INTR: Interrupt Request.
– Input signal into the CPU
– If it is activated, the CPU will finish the current instruction and respond with
the interrupt acknowledge operation
– Can be masked (ignored) thru instructions CLI and STI
• NMI: NonMaskable interrupt.
– Input signal
– Cannot be masked or unmasked thru CLI and STI
– Examples of use: power frailer. Memory error
• INTA: Interrupt Acknowledge.
– Output signal
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
The Interrupt flag
• IF (Interrupt Enable Flag) D9: used to mask any hardware interrupt
that may come in from the INTR pin.
• When IF=0, all hardware interrupt requests through INTR are masked.
• This has no effect on interrupts coming from the NMI pin.
• CLI sets IF to 0, STI sets IF to 1.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Block Diagram of 8259
8259 Interrupt IC
• It can manage 8 – priority interrupts, which is equivalent to provide 8 –
interrupt pins on a processor instead of single INTR pin.
• By cascading number of 8259 IC’s, it is possible to generate more than 8 –
interrupts.
• Due to the availability of IMR (Interrupt Mask Register), it is possible to
mask any or all the interrupt request to 8259.
1. Data Bus Buffer:
• This block is used to write control word or to read the status value. It is
bidirectional 8-bit buffer which is also used to send the address of the ISR.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
8259 Interrupt IC
2. Read/Write Control Logic:
• This block comprises of various control signals such as RD, WR, A0, CS.
The RD/WR control signal are used for read/write operation, whereas A0
address line is used to select the different command words as shown
below.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
A0 Control Word Kinds of Control
Word
0 ICW ICW1 (A0 = 0)
ICW2 (A0 = 1)
ICW3 (A0 = 1)
ICW4 (A0 = 1)
1 OCW OCW1 (A0 = 1)
OCW2 (A0 = 0)
OCW3 (A0 = 0)
8259 Interrupt IC
• Out of these above command words, ICW1 & ICW2 are compulsory,
whereas others are optional taken as and when required.
3. Cascade Buffer:
• In order to expand various interrupt levels, 8259 can be cascaded with
various other 8259 IC’s. This cascade buffer generates necessary control
signals for cascade (master/slave) operation of 8259.
• Here SP/EN is connected to +Vcc for mater, otherwise grounded for
slave.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
8259 Interrupt IC
4. Registers:
i. IRR (Interrupt Request Register):
• An IRR is used to store the interrupt level which is requesting for
interrupt service. The 8 interrupt input sets the corresponding bits in
IRR as shown below.
1: Interrupt Request
0 : No request
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
IR7 IR6 IR5 IR4 IR3 IR2 IR1 IR0
8259 Interrupt IC
ii. IMR (Interrupt Mask Register):
• An IMR stores the masking bit pattern for the interrupt level to be
masked or ignored. This register can be programmable by using
OCW1 of 8259.
• The structure of IMR is as shown below.
1: Respective Interrupt Mask (ignore)
0 : Respective Interrupt Unmask (accept)
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
IR7 IR6 IR5 IR4 IR3 IR2 IR1 IR0
8259 Interrupt IC
3. ISR (Interrupt Service Register):
• It gives the status of current interrupt level being serviced by the
microprocessor.
• The microprocessor executes an ISS (Interrupt Service Sub Routine)
program in response to each interrupt, it means the processor will be
giving service to only single interrupt at a time.
4. Priority Resolver:
• It determines the priorities of different interrupts requested inside
IRR. Depending upon the priority set as Fixed type, a higher priority
interrupt is selected by the resolver.
• While forwarding that interrupt to the processor, the PRL also
monitors IMR and ISR.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
8259 Interrupt IC
5. Interrupt Control Logic:
• This block will forward an interrupt request from 8259 to 8086, in
response to which the processor gives an acknowledgement through
INTA.
• This INTA shows an acceptance of the interrupt by the processor.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Priority Modes of Intel 8259
• Intel 8259 can be operated in one of the following mode as:
1. Fully Nested Mode (FNM) / Default Mode.
2. Special Fully Nested Mode (SFNM).
3. Special Mask Mode (SMM).
4. Rotating Priority Mode
1. Automatic Rotation
2. Specific Rotation
5. Polled Mode.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Command Words of Intel 8259
• There are 2 types of command words available in 8259
1. Initialization Command Word (ICW)
2. Operational Command Word (OCW)
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
ICW1:
• Bit D0 is used to specify the need of ICW4, if this bit is set to 0, then
ICW4 is not needed and vice versa.
• Bit D1 is used to specify whether single 8259 is used or 8259 is
operated in cascade mode.
• Bit D2 is used to specify an address interval between two successive
ISS location either separated by 4 byte or 8 byte.
• Bit D3 is used to initiate an interval either level triggered or edge
triggered.
• Bit D4 is permanently kept at logic 1 whereas D5, D6 & D7 are
undefined.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
ICW2:
• This is used to specify a 8 bit pointer value for address of different ISS.
• This address is given from INT0 to INT7, here bit D0 to D2 are used to
specify an interrupt level.
• Whereas bits D3 to D7 are used to specify an ISS pointer value for
each interrupt level.
• Therefore A11 … A15 will give 25 = 32 address values for each
interrupt levels, and hence 32*8 = 256 address values can be given for
all interrupts of 8259.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
ICW3:
• There are two types of ICW3 used in cascade configuration, it means
in case of single 8259 there is no need of ICW3.
1. ICW3 for Master
2. ICW3 for Slave
ICW3 for Master :
• In the format shown above, the presence or absence of various slaves
is provided by writing logic 1 or logic 0 respectively.
• If slaves are connected then respective bit must be set to logic 1.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
ICW3 for Slave:
• This is used to provide slave ID. This slave ID or address is provided
through D0, D1 & D2.
• The remaining bits are kept at logic 0.
ICW4:
• It is an optional command word in which bit D0 is used to specify the
microprocessor used.
• Bit D1 is used to implement AEOI or EOI.
• Bit D2 & D3 are only used during master/slave configuration whereas
bit D4 is used for SFNM or FNM. Others are always 0.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Initialization Sequence of 8259
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Operational Command Words
OCW1:
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
OCW2:
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
OCW3:
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Problems:
1. Specify the value of ICW1 needed to configure an 8259 as follows:
ICW4 not needed, single device interface and edge triggered inputs.
2. Specify the value of ICW4 such that the 8259 is configured for use in
8086 system, with normal EOI, buffered mode master and SFNM
mode disabled.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
Answers:
1.
2.
4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact:
karthik8777@gmail.com, 9096996329
x x x 1 0 x 1 0
0 0 0 0 1 1 0 1

More Related Content

What's hot

Writing c code for the 8051
Writing c code for the 8051Writing c code for the 8051
Writing c code for the 8051
Quản Minh Tú
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)
Safin Biswas
 
Addressing mode
Addressing modeAddressing mode
Addressing mode
ilakkiya
 

What's hot (20)

Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086
 
8085:branching and logical instruction
8085:branching and logical instruction8085:branching and logical instruction
8085:branching and logical instruction
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
 
8086 Microprocessor
8086 Microprocessor8086 Microprocessor
8086 Microprocessor
 
Assembly 8086
Assembly 8086Assembly 8086
Assembly 8086
 
8085 branching instruction
8085 branching instruction8085 branching instruction
8085 branching instruction
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1
 
Subroutine in 8051 microcontroller
Subroutine in 8051 microcontrollerSubroutine in 8051 microcontroller
Subroutine in 8051 microcontroller
 
Writing c code for the 8051
Writing c code for the 8051Writing c code for the 8051
Writing c code for the 8051
 
8051 basic programming
8051 basic programming8051 basic programming
8051 basic programming
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)
 
Different addressing mode and risc, cisc microprocessor
Different addressing mode and risc, cisc microprocessorDifferent addressing mode and risc, cisc microprocessor
Different addressing mode and risc, cisc microprocessor
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Mp &mc programs
Mp &mc programsMp &mc programs
Mp &mc programs
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Addressing mode
Addressing modeAddressing mode
Addressing mode
 
Time delay programs and assembler directives 8086
Time delay programs and assembler directives 8086Time delay programs and assembler directives 8086
Time delay programs and assembler directives 8086
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 

Viewers also liked (6)

instruction set of 8086
instruction set of 8086instruction set of 8086
instruction set of 8086
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086 instruction set with types
8086 instruction set with types8086 instruction set with types
8086 instruction set with types
 
8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 

Similar to Unit 6 assembly language programming

21262738 8259a-programmable-interrupt-controller-2
21262738 8259a-programmable-interrupt-controller-221262738 8259a-programmable-interrupt-controller-2
21262738 8259a-programmable-interrupt-controller-2
lords_ko
 
8259 A P R O G R A M M A B L E I N T E R R U P T C O N T R O L L E R2
8259 A  P R O G R A M M A B L E  I N T E R R U P T  C O N T R O L L E R28259 A  P R O G R A M M A B L E  I N T E R R U P T  C O N T R O L L E R2
8259 A P R O G R A M M A B L E I N T E R R U P T C O N T R O L L E R2
Aisu
 
Topic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structureTopic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structure
Bai Haqi
 

Similar to Unit 6 assembly language programming (20)

8259 updated
8259 updated 8259 updated
8259 updated
 
8259 Interrupt Controller
8259 Interrupt Controller8259 Interrupt Controller
8259 Interrupt Controller
 
Micro unit 8
Micro unit 8Micro unit 8
Micro unit 8
 
B sc e5.2 mp unit 3 interfacing
B sc e5.2 mp unit 3 interfacingB sc e5.2 mp unit 3 interfacing
B sc e5.2 mp unit 3 interfacing
 
3.programmable interrupt controller 8259
3.programmable interrupt controller 82593.programmable interrupt controller 8259
3.programmable interrupt controller 8259
 
21262738 8259a-programmable-interrupt-controller-2
21262738 8259a-programmable-interrupt-controller-221262738 8259a-programmable-interrupt-controller-2
21262738 8259a-programmable-interrupt-controller-2
 
8259 A P R O G R A M M A B L E I N T E R R U P T C O N T R O L L E R2
8259 A  P R O G R A M M A B L E  I N T E R R U P T  C O N T R O L L E R28259 A  P R O G R A M M A B L E  I N T E R R U P T  C O N T R O L L E R2
8259 A P R O G R A M M A B L E I N T E R R U P T C O N T R O L L E R2
 
8259a.pdf
8259a.pdf8259a.pdf
8259a.pdf
 
8259
82598259
8259
 
Timing n interrupt.pptx
Timing n interrupt.pptxTiming n interrupt.pptx
Timing n interrupt.pptx
 
8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay8259 Programmable Interrupt Controller by vijay
8259 Programmable Interrupt Controller by vijay
 
Introduction to 8085svv
Introduction to 8085svvIntroduction to 8085svv
Introduction to 8085svv
 
MICROPROCESSOR_Notes.pptx
MICROPROCESSOR_Notes.pptxMICROPROCESSOR_Notes.pptx
MICROPROCESSOR_Notes.pptx
 
Introduction to Interrupts of 8085 microprocessor
Introduction to Interrupts of 8085 microprocessorIntroduction to Interrupts of 8085 microprocessor
Introduction to Interrupts of 8085 microprocessor
 
Intel 8259 - Programmable Interrupt Controller
Intel 8259 - Programmable Interrupt Controller  Intel 8259 - Programmable Interrupt Controller
Intel 8259 - Programmable Interrupt Controller
 
8259.pptx
8259.pptx8259.pptx
8259.pptx
 
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
 
With suitable diagram explain the working of 8255 a and inerrupts
With suitable diagram explain the working of 8255 a and inerruptsWith suitable diagram explain the working of 8255 a and inerrupts
With suitable diagram explain the working of 8255 a and inerrupts
 
Microprocessor and Microcontroller lec5
Microprocessor and Microcontroller lec5Microprocessor and Microcontroller lec5
Microprocessor and Microcontroller lec5
 
Topic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structureTopic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structure
 

Recently uploaded

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 

Unit 6 assembly language programming

  • 1. UNIT 6 – Assembly Language Programming -By Prof. K. U. Sharma
  • 2. Introduction • An interrupt is an event which informs the CPU that its service (action) is needed. • Sources of interrupts: – internal fault (e.g.. divide by zero, overflow) – software – external hardware : • maskable • nonmaskable – reset 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 3. Interrupt Terminologies • Interrupt pins: Set of pins used in hardware interrupts • Interrupt Service Routine (ISR) or Interrupt handler: code used for handling a specific interrupt • Interrupt priority: In systems with more than one interrupt inputs, some interrupts have a higher priority than other – They are serviced first if multiple interrupts are triggered simultaneously • Interrupt vector: Code loaded on the bus by the interrupting device that contains the Address (segment and offset) of specific interrupt service routine • Interrupt Masking: Ignoring (disabling) an interrupt • Non-Maskable Interrupt: Interrupt that cannot be ignored (power- down) 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 4. Interrupt Vectors • The processor uses the interrupt vector to determine the address of the ISR of the interrupting device. • In the 8088/8086 processor as well as in the 80386/80486/Pentium processors operating in Real Mode (16-bit operation), the interrupt vector is a pointer to the Interrupt Vector Table. – The Interrupt Vector Table occupies the address range from 00000H to 003FFH (the first 1024 bytes in the memory map). – Each entry in the Interrupt Vector Table is 4 bytes long: • The first two represent the offset address and the last two the segment address of the ISR. – The first 5 vectors are reserved by Intel to be used by the processor. • The vectors 5 to 255 are free to be used by the user. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 5. Basic Procedure for Processing Interrupts • When an interrupt is executed, the mp: – finishes executing its current instruction (if any). – saves (PUSH) the flag register, IP and CS register in the stack. – goes to a fixed memory location. – reads the address of the associated ISR. – Jumps to that address and executes the ISR. – gets (PULL) the flag register, CS:IP register from the stack. – continues executing the previous job (if any). 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 6. 8088/86 Hardware Interrupts pins INTR: Interrupt Request. – Input signal into the CPU – If it is activated, the CPU will finish the current instruction and respond with the interrupt acknowledge operation – Can be masked (ignored) thru instructions CLI and STI • NMI: NonMaskable interrupt. – Input signal – Cannot be masked or unmasked thru CLI and STI – Examples of use: power frailer. Memory error • INTA: Interrupt Acknowledge. – Output signal 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 7. The Interrupt flag • IF (Interrupt Enable Flag) D9: used to mask any hardware interrupt that may come in from the INTR pin. • When IF=0, all hardware interrupt requests through INTR are masked. • This has no effect on interrupts coming from the NMI pin. • CLI sets IF to 0, STI sets IF to 1. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 8. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329 Block Diagram of 8259
  • 9. 8259 Interrupt IC • It can manage 8 – priority interrupts, which is equivalent to provide 8 – interrupt pins on a processor instead of single INTR pin. • By cascading number of 8259 IC’s, it is possible to generate more than 8 – interrupts. • Due to the availability of IMR (Interrupt Mask Register), it is possible to mask any or all the interrupt request to 8259. 1. Data Bus Buffer: • This block is used to write control word or to read the status value. It is bidirectional 8-bit buffer which is also used to send the address of the ISR. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 10. 8259 Interrupt IC 2. Read/Write Control Logic: • This block comprises of various control signals such as RD, WR, A0, CS. The RD/WR control signal are used for read/write operation, whereas A0 address line is used to select the different command words as shown below. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329 A0 Control Word Kinds of Control Word 0 ICW ICW1 (A0 = 0) ICW2 (A0 = 1) ICW3 (A0 = 1) ICW4 (A0 = 1) 1 OCW OCW1 (A0 = 1) OCW2 (A0 = 0) OCW3 (A0 = 0)
  • 11. 8259 Interrupt IC • Out of these above command words, ICW1 & ICW2 are compulsory, whereas others are optional taken as and when required. 3. Cascade Buffer: • In order to expand various interrupt levels, 8259 can be cascaded with various other 8259 IC’s. This cascade buffer generates necessary control signals for cascade (master/slave) operation of 8259. • Here SP/EN is connected to +Vcc for mater, otherwise grounded for slave. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 12. 8259 Interrupt IC 4. Registers: i. IRR (Interrupt Request Register): • An IRR is used to store the interrupt level which is requesting for interrupt service. The 8 interrupt input sets the corresponding bits in IRR as shown below. 1: Interrupt Request 0 : No request 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329 IR7 IR6 IR5 IR4 IR3 IR2 IR1 IR0
  • 13. 8259 Interrupt IC ii. IMR (Interrupt Mask Register): • An IMR stores the masking bit pattern for the interrupt level to be masked or ignored. This register can be programmable by using OCW1 of 8259. • The structure of IMR is as shown below. 1: Respective Interrupt Mask (ignore) 0 : Respective Interrupt Unmask (accept) 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329 IR7 IR6 IR5 IR4 IR3 IR2 IR1 IR0
  • 14. 8259 Interrupt IC 3. ISR (Interrupt Service Register): • It gives the status of current interrupt level being serviced by the microprocessor. • The microprocessor executes an ISS (Interrupt Service Sub Routine) program in response to each interrupt, it means the processor will be giving service to only single interrupt at a time. 4. Priority Resolver: • It determines the priorities of different interrupts requested inside IRR. Depending upon the priority set as Fixed type, a higher priority interrupt is selected by the resolver. • While forwarding that interrupt to the processor, the PRL also monitors IMR and ISR. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 15. 8259 Interrupt IC 5. Interrupt Control Logic: • This block will forward an interrupt request from 8259 to 8086, in response to which the processor gives an acknowledgement through INTA. • This INTA shows an acceptance of the interrupt by the processor. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 16. Priority Modes of Intel 8259 • Intel 8259 can be operated in one of the following mode as: 1. Fully Nested Mode (FNM) / Default Mode. 2. Special Fully Nested Mode (SFNM). 3. Special Mask Mode (SMM). 4. Rotating Priority Mode 1. Automatic Rotation 2. Specific Rotation 5. Polled Mode. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 17. Command Words of Intel 8259 • There are 2 types of command words available in 8259 1. Initialization Command Word (ICW) 2. Operational Command Word (OCW) 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 18. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 19. ICW1: • Bit D0 is used to specify the need of ICW4, if this bit is set to 0, then ICW4 is not needed and vice versa. • Bit D1 is used to specify whether single 8259 is used or 8259 is operated in cascade mode. • Bit D2 is used to specify an address interval between two successive ISS location either separated by 4 byte or 8 byte. • Bit D3 is used to initiate an interval either level triggered or edge triggered. • Bit D4 is permanently kept at logic 1 whereas D5, D6 & D7 are undefined. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 20. ICW2: • This is used to specify a 8 bit pointer value for address of different ISS. • This address is given from INT0 to INT7, here bit D0 to D2 are used to specify an interrupt level. • Whereas bits D3 to D7 are used to specify an ISS pointer value for each interrupt level. • Therefore A11 … A15 will give 25 = 32 address values for each interrupt levels, and hence 32*8 = 256 address values can be given for all interrupts of 8259. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 21. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 22. ICW3: • There are two types of ICW3 used in cascade configuration, it means in case of single 8259 there is no need of ICW3. 1. ICW3 for Master 2. ICW3 for Slave ICW3 for Master : • In the format shown above, the presence or absence of various slaves is provided by writing logic 1 or logic 0 respectively. • If slaves are connected then respective bit must be set to logic 1. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 23. ICW3 for Slave: • This is used to provide slave ID. This slave ID or address is provided through D0, D1 & D2. • The remaining bits are kept at logic 0. ICW4: • It is an optional command word in which bit D0 is used to specify the microprocessor used. • Bit D1 is used to implement AEOI or EOI. • Bit D2 & D3 are only used during master/slave configuration whereas bit D4 is used for SFNM or FNM. Others are always 0. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 24. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 25. Initialization Sequence of 8259 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 26. Operational Command Words OCW1: 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 27. OCW2: 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 28. OCW3: 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 29. Problems: 1. Specify the value of ICW1 needed to configure an 8259 as follows: ICW4 not needed, single device interface and edge triggered inputs. 2. Specify the value of ICW4 such that the 8259 is configured for use in 8086 system, with normal EOI, buffered mode master and SFNM mode disabled. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329
  • 30. Answers: 1. 2. 4/5/2014 Prof. K. U. Sharma, PRMCEAM, Contact: karthik8777@gmail.com, 9096996329 x x x 1 0 x 1 0 0 0 0 0 1 1 0 1