Professional Documents
Culture Documents
BIOS and DOS Interrupts: Basic Input /outpu System Disk Operating System
BIOS and DOS Interrupts: Basic Input /outpu System Disk Operating System
Computer Interrupt
2 General Types of Interrupts:
External - generated outside CPU by other hardware Internal - generated within CPU as a result of instruction or operation
- x86 internals: int, into, divide error, and single step - trap generally means any processor generated interrupt; in x86, usually means the single step interrupt
1) Hardware Interrupt External, uses INTR and NMI control bus lines 2) Software Interrupt Internal, from int or into 3) Processor Interrupt traps, exceptions
8086
8088
8086 Pin 31 30 29 28 27 26 25 24 Minimum HOLD HLDA WR M/IO DT/R DEN ALE INTA Mode Maximum RQ/GT0 RQ/GT1 LOCK S2 S1 S0 QS0 QS1 Pin 31 30 29 28 27 26 25 24 34
8088 Mode Minimum HOLD HLDA WR IO/M DT/R DEN ALE INTA SS0 Maximum RQ/GT0 RQ/GT1 LOCK S2 S1 S0 QS0 QS1 High State
NMI
8086 CPU
INTR
Interrupt Logic
int
into
Divide Error
Single Step
Software
Traps
IVT Format
0000:0000 0000:0001 0000:0002 0000:0003 0000:0004 0000:0005 0000:0006 0000:0007
Offset Interrupt 0 Segment Offset Segment Given a Vector, where is the ISR address stored in memory ?
IP LSB IP MSB CS LSB
Interrupt 1
CS MSB
Offset = Type 4
0000:03fc 0000:03fd 0000:03fe 0000:03ff
Example:
int 36h
push Flags
Internal Interrupt
NO
Set TEMP=TF
TF=TEMP
YES
NMI
NO
IF=0 TF=0
pop IP and CS
INTR
NO
YES
IF
0
push CS and IP
popf
TF
0
call ISR
NMI
NO
YES
This is why ALL programs MUST have a stack segment, so that interrupts can be handled
halt Instruction
This instruction causes processor to enter a HALT state HALT state is one where no further instructions are fetched one of the following events occurs: nor executed until
AT IRQ Definitions
IBM-AT (Advanced Technology) - Intel 80286
Name NMI IRQ0 IRQ1 IRQ2 IRQ3 IRQ4 IRQ5 IRQ6 IRQ7 IRQ8 IRQ9 IRQ10 IRQ11 IRQ12 IRQ13 IRQ14 IRQ15 Interrupt Vector 02 08 09 0A 0B 0C 0D 0E 0F 70 71 72 73 74 75 76 77 Priority 1 2 3 4 13 14 15 16 17 5 6 7 8 9 10 11 12 Description Memory Parity Error Timer (Intel 8253 Chip 55 ms intervals) Keyboard 8259 PIC Slave or EGA/VGA Vert. Retrace Serial Port (COM2 or COM4) Serial Port (COM1 or COM3) Fixed Disk or LPT2 Request Floppy Disk Driver LPT1 Request CMOS Real-Time Clock (RT Chip) Re-directed to IRQ2 RESERVED RESERVED Mouse or other Math Coprocessor (NPX) Hard Disk RESERVED
HW#1
Develop an assembly program that receives a decimal number (up to max 100 digits) from user and displays its hexadecimal equivallent.
Due Date: Sunday Esfand 23rd Mail to: Mr Kazari and me (vahdat@sharif.edu or vosoughivahdat@yahoo.com) Subject: HW1 UPI2010 IDxxxxxxxx