static struct segoff __text16 ( int20_vector ); #define int20_vector __use_text16 ( int20_vector ) extern void int20_wrapper ( void ); static __cdecl void int20 ( struct i386_all_regs *ix86 ) { // INT 20 handler goes here } static void hook_int20 ( void ) { __asm__ __volatile__ ( TEXT16_CODE ( "\nint20_wrapper:\n\t" "pushl %0\n\t" "pushw %%cs\n\t" "call prot_call\n\t" "addw $4, %%sp\n\t" "iret\n\t" ) : : "i" ( int20 ) ); hook_bios_interrupt ( 0x20, ( unsigned int ) int20_wrapper, &int20_vector ); }