2 * Interrupt vectors emulation
4 * Copyright 1995 Alexandre Julliard
11 #include "registers.h"
12 #include "stackframe.h"
16 static SEGPTR INT_Vectors
[256];
18 /* Ordinal number for interrupt 0 handler in WINPROCS.DLL */
19 #define FIRST_INTERRUPT_ORDINAL 100
22 /**********************************************************************
28 HMODULE hModule
= GetModuleHandle( "WINPROCS" );
30 for (vector
= 0; vector
< 256; vector
++)
32 if (!(INT_Vectors
[vector
] = MODULE_GetEntryPoint( hModule
,
33 FIRST_INTERRUPT_ORDINAL
+vector
)))
35 fprintf(stderr
,"Internal error: no vector for int %02x\n",vector
);
43 /**********************************************************************
46 * Return the interrupt vector for a given interrupt.
48 SEGPTR
INT_GetHandler( BYTE intnum
)
50 return INT_Vectors
[intnum
];
54 /**********************************************************************
57 * Set the interrupt handler for a given interrupt.
59 void INT_SetHandler( BYTE intnum
, SEGPTR handler
)
61 dprintf_int( stddeb
, "Set interrupt vector %02x <- %04x:%04x\n",
62 intnum
, HIWORD(handler
), LOWORD(handler
) );
63 INT_Vectors
[intnum
] = handler
;
67 /**********************************************************************
70 void INT_DummyHandler( struct sigcontext_struct context
)
73 CURRENT_STACK16
->ordinal_number
- FIRST_INTERRUPT_ORDINAL
);
77 /**********************************************************************
80 * Handler for int 11h (get equipment list).
82 void INT_Int11Handler( struct sigcontext_struct context
)
84 AX_reg(&context
) = DOS_GetEquipment();
88 /**********************************************************************
91 * Handler for int 12h (get memory size).
93 void INT_Int12Handler( struct sigcontext_struct context
)
95 AX_reg(&context
) = 640;
99 /**********************************************************************
102 * Handler for int 15h.
104 void INT_Int15Handler( struct sigcontext_struct context
)
106 INT_BARF( &context
, 0x15 );
110 /**********************************************************************
113 * Handler for int 16h (keyboard).
115 void INT_Int16Handler( struct sigcontext_struct context
)
117 INT_BARF( &context
, 0x16 );