Created
March 10, 2017 18:18
-
-
Save AaronC81/a4c7d6f529a8ec6dab8a56a701aab129 to your computer and use it in GitHub Desktop.
MS-DOS Interrupt Service Routine Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <dos.h> | |
void interrupt far (*oldhandler)(...); | |
void interrupt myhandler(...) { | |
printf("Timer Tick!\n"); | |
oldhandler(); | |
} | |
int main() { | |
printf("Hooking timer interrupt 0x1C...\n"); | |
oldhandler = getvect(0x1c); | |
setvect(0x1c, myhandler); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment