Set 20 Interrupts. INTERRUPTS The Pentium has a mechanism whereby external devices can interrupt it. Devices such as the keyboard, the monitor, hard disks.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

There are two types of addressing schemes:
Lecture 12 Z80 Interrupt 동국대학교 홍유표 1. Y. Hong & E. Lee Polling vs. Interrupt Polling : Periodically check if an event occurs Interrupt : Event sends a.
Unit 4 Chapter-1 Multitasking. The Task State Segment.
Flow Diagram: Push flags, CS, IP Pop IP,CS,flags Push AX,BX,CX,DX,ES,DS,SI,DI,BP POP BP,DI,SI,DS,ES,DX,CX,BX,AX.
Lecture 6 Machine Code: How the CPU is programmed.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#4)
LOGO Chapter 1 Interrupt handling. hardware interrupt Under x86, hardware interrupts are called IRQ's. When the CPU receives an interrupt, it stops whatever.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Interrupt Processing Haibo Wang ECE Department
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Introduction to Interrupts
Introduction to Computer Engineering by Richard E. Haskell Interrupts Module M17.3 Sections 11.3, 14.1.
8.4 Instruction Execution Times TOBIN PROC FAR SUB AX,AX MOV DX,AX MOV CX,4 NEXTD: PUSH CX SUB BP,BP MOV CX,4 GETNUM: RCL BX,1 RCL BP,1 LOOP GETNUM.
Practical Session No. 10 Input &Output (I/O). I/O Devices Input/output (I/O) devices provide the means to interact with the “outside world”. An I/O device.
Chapter 11 Interrupt Interface of the 8088 and 8086 Microcomputer
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
Micro-Computer Applications: Procedures & Interrupts Dr. Eng. Amr T. Abdel-Hamid ELECT 707 Fall 2011.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Microprocessors 1 MCS-51 Interrupts.
Interrupts Useful in dealing with: The interface: Random processes;
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
INT- interrupt program execution 1. It decrements the sp by 2 and pushes the flag registers on the stack. 2. Decrement the sp by 2 and push the content.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
SET 21 OPERATING SYSTEM USE OF ASSEMBLY LANGUAGE.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
EEL 3801 Part IV The Assembler. OFFSET Operator Returns address of variable used as operand. Actually, it represents the offset from the beginning of.
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
Interrupts.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
9/20/6Lecture 3 - Instruction Set - Al1 Exception Handling.
Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
BIOS and DOS Interrupts Basic Input /Outpu System Disk Operating System.
Khaled A. Al-Utaibi  Introduction  The MOV Instruction  The LEA Instruction  The Stack Instructions  The String Data Transfer.
Assembly Language Lecture 2. Lecture Outline Program Structure Memory models Data Segment Stack Segment Code Segment Input and Output Instructions INT.
Internal Programming Architecture or Model
File Operations. FILE PROCESSING For the purposes of the following discussion, reading means copying all or part of an existing file into memory Writing.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Computer System Structures Interrupts
Interrupts and interrupt responses
Format of Assembly language
MICROPROCESSOR BASED SYSTEM DESIGN
Microprocessor and Assembly Language
Microprocessor Systems Design I
Anton Burtsev February, 2017
Protection of System Resources
Interrupts In 8085 and 8086.
Interrupts – (Chapter 12)
CS 3305 System Calls Lecture 7.
8259 Chip The Intel 8259 is a family of Programmable Interrupt Controllers (PIC) designed and developed for use with the Intel 8085 and Intel 8086 microprocessors.
Chapter 4 Data Movement Instructions
8086 Registers Module M14.2 Sections 9.2, 10.1.
Interrupts Interrupt is a process where an external device can get the attention of the microprocessor. The process starts from the I/O device The process.
11.1 Interrupt Mechanism, Type, and Priority
Symbolic Instruction and Addressing
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Operating Systems Lecture 3.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Microprocessor and Assembly Language
Lecture 12 Input/Output (programmer view)
Presentation transcript:

Set 20 Interrupts

INTERRUPTS The Pentium has a mechanism whereby external devices can interrupt it. Devices such as the keyboard, the monitor, hard disks etc. can cause such interrupts, when they require service of some kind, such as to get or receive a byte. For example, when you press a key on the keyboard this causes an interrupt. 2

WHAT HAPPENS WHEN AN INTERRUPT OCCURS When the pentium is interrupted, it completes the current instruction, then pushes onto the stack the flags register plus the address of the next instruction (the return address). It then carries out the procedure that services the interrupt involved. Then it uses a special return instruction iret which pops the flags register from the stack, and pops and uses the return address to resume doing whatever it was doing before the interrupt occurred. 3

EXAMPLES OF INTERRUPT ROUTINES When you press a key on the keyboard, the interrupt routine that the Pentium carries out is to input the key and store it in a buffer in memory. Another example is provided by a separate timer chip which interrupts the Pentium typically every 10 milliseconds. This interrupt is called a timer tick. Here the Pentium’s interrupt routine updates it’s time of day (it actually stores the number of timer ticks since midnight). 4

HOW DOES THE PENTIUM KNOW WHAT CAUSED THE INTERRUPT? 5 PENTIUM INTERRUPT CONTROLLER from the timer chip from the keyboard from the monitor data bus interrupt requested interrupt acknowledged identification of the interrupt

1.The device signals its request, for an interrupt service, to the interrupt controller. 2.The interrupt controller sends a signal to the Pentium requesting an interrupt. 3.The Pentium is hard-wired to respond by finishing its current instruction, pushing the flags register, and the address of the next instruction (the return address) onto the stack, and then sending an acknowledgment signal back to the interrupt controller. 4.The interrupt controller then puts onto the data bus a code that identifies which which of its input lines (and hence which device) is requesting this interrupt. 6

HOW THE PENTIUM FINDS THE CORRECT INTERRUPT ROUTINE All Pentiums maintain an area of memory at the same fixed location called a jump table. This consists of a sequence of 4 byte entries, where each entry consists of an (offset value, segment register value). These entries (called interrupt vectors) specify the locations of the various interrupt routines. The code that the interrupt routine sends the Pentium, to identify the kind of interrupt, is used to index this jump table and so locate the appropriate interrupt routine. 7

NOTES From the instant the device signals its request for an interrupt routine, up to when the Pentium starts executing the routine required, everything described on the proceeding slides takes place automatically entirely by wired-in hardware. The jump table makes it simple for new versions of the interrupt routines to be written and placed at different locations in memory when new versions of the operating system are produced. All that needs to be changed is the corresponding entries in the jump table. 8

INTERRUPT VECTOR NUMBERS The 4 byte entries (interrupt vectors) in the jump table are numbered. For example interrupt vector 9 is for the keyboard, and interrupt vector 3Ch is for the timer tick. 9

RETRIEVING & CHANGING INTERRUPT VECTORS The code to retrieve an interrupt vector (so you can store & later restore it) is of the form: MOV AL,… ; the interrupt vector no., e.g. 9 for the keyboard MOV AH, 35h INT 21h This puts the offset value part of the interrupt vector into BX, and the segment register part into ES The code to change an interrupt vector is of the form: MOV AL,… ; the interrupt vector no. LEA DX,… ; the offset of the new interrupt routine ; DS should contain the segment value concerned MOV AH, 25H INT 21H 10