Skip to content

Instantly share code, notes, and snippets.

@AaronC81
Created March 10, 2017 18:18
Show Gist options
  • Save AaronC81/a4c7d6f529a8ec6dab8a56a701aab129 to your computer and use it in GitHub Desktop.
Save AaronC81/a4c7d6f529a8ec6dab8a56a701aab129 to your computer and use it in GitHub Desktop.
MS-DOS Interrupt Service Routine Example
#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