![Page 1: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/1.jpg)
Another Example:#include<BIOS.H>#include<DOS.H>char st[80] ={"Hello World$"};char st1[80] ={"Hello Students!$"};void interrupt (*oldint65)( );void interrupt newint65( );void main(){ oldint65 = getvect(0x65); setvect(0x65, newint65); keep(0, 1000);}
![Page 2: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/2.jpg)
Continued:void interrupt newint65( ){
if (( _AH ) = = 0){
_AH = 0x09;_DX = (unsigned int) st;geninterrupt (0x21);
}else{
if (( _AH ) = = 1){
_AH = 0x09;_DX = (unsigned int) st1;geninterrupt (0x21);
}}
}
![Page 3: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/3.jpg)
2nd Program:#include<BIOS.H>#include<DOS.H>void main(){
_AH = 1;geninterrupt (0x65);_AH = 0;geninterrupt (0x65);
}
![Page 4: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/4.jpg)
Interrupt Interception Hooks/Stealing
![Page 5: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/5.jpg)
Execution Interrupted
ISR Perform I/O
Normal Execution of Interrupt
![Page 6: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/6.jpg)
Interrupt Interception
New Routine
Original Routine
![Page 7: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/7.jpg)
Other form of Interrupt Interception
New Routine
Original Routine
![Page 8: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/8.jpg)
void Interrupt newint();void Interrupt (*old)();void main(){old=getvect(0x08);Setvect(0x08,newint);Keep(0,1000);}void interrupt newint (){(*old)();}
![Page 9: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/9.jpg)
Timer Interrupt
![Page 10: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/10.jpg)
Hardware InterruptsInvoked by Means of Hardware
Approximately occurs 18.2 times per second
![Page 11: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/11.jpg)
BIOS Data Area0040:0000
![Page 12: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/12.jpg)
7 6 5 4 3 2 1 0
Right Shift key
Left Shift Key
Ctrl Key
Alt Key
Insert key
Caps Lock Key
Num Lock key
Scroll lock key
40:17H
Keyboard Status Word
![Page 13: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/13.jpg)
#include <dos.h>void Interrupt (*old)();void Interrupt new();Char far *scr=(char far* ) 0x00400017;Void main(){old=getvect(0x08);Setvect(0x08,new);Keep(0,1000);}Void interrupt new (){*scr=64;(*old)();}
![Page 14: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/14.jpg)
Interrupt Interception
New Routine
Original Routine
![Page 15: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/15.jpg)
Memory Mapped Isolated I/O
![Page 16: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/16.jpg)
Isolated I/O
MP I/O
IN
OUT
![Page 17: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/17.jpg)
Memory Mapped I/O
MP I/O
MOV
MOV
![Page 18: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/18.jpg)
Memory Mapped I/O ON Monitor
B8OO:0000B8OO:0001
B8OO:0002B8OO:0003
Low Byte = ASCII CODEHigh Byte =Attribute Byte
![Page 19: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/19.jpg)
Memory Mapped I/O ON Monitor
X X X X X X X X
Back Color ColorBold
Blink
Low Byte = Ascii CodeHigh Byte = Attribute Byte
000 Black
100 Red
010 Green
001 Blue
111 White
fore color
![Page 20: Another Example: #include char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( );](https://reader035.vdocuments.us/reader035/viewer/2022072112/56649eb55503460f94bbe4bb/html5/thumbnails/20.jpg)
unsigned int far *scr=0xb8000000;
void main(){
(*scr)=0x0756;(*(scr+1))=0x7055;
}