Advertisement

Problems with _dos_setvect

Started by August 22, 2000 01:08 PM
1 comment, last by Ut 24 years, 4 months ago
I''m following one of LaMothe''s older books (Black Art of 3D, and TGPG ) and in Black Art he writes a keyboard driver. Well, I thought I''d follow along, but am getting compiler errors about _dos_setvect. It goes as follows // holds old keyboard interrupt handler void ( _interrupt _far* Old_Keyboard_ISR )(...); ... _dos_setvect( KEYBOARD_INTERRUPT, Old_Keyboard_ISR ); ERROR: Cannot convert ''void(*)(...)'' to ''void (interrupt *)(...)'' I had similiar problems with _dos_getvect and _dos_setvect with my own Keyboard driver, but I can''t seem to fix this one. I''ve tried casting like this _dos_setvect( KEYBOARD_INTERRUPT, ( void (interrupt *)(...))Old_Keyboard_ISR ) but that doesn''t work. I''m using Borland C++ 5.02 if that matters. Thanks for any suggestions. Ut
You must declare the interupt function to be a interupt function try:

void interrupt Function()
{
}
instead of this
void Function()
{
}

Since there is some things that is done in a diffrent way with interupt functions the compiler must know that it´s a interupt function
ex. return from a standard function is ret while from a interupt iret
Advertisement
Yes. What you said works. My problem comes in trying to reload the old keyboard driver. The only way (I know of) is to save it off in a function pointer. When I try to use this function pointer to reset the driver, _dos_setvect complains about getting an improper type. I''ve tried to cast it to the correct type, but "interrupt" is invisible to the cast.

Ut

quote: Original post by MatsG

You must declare the interupt function to be a interupt function try:

void interrupt Function()
{
}
instead of this
void Function()
{
}

Since there is some things that is done in a diffrent way with interupt functions the compiler must know that it´s a interupt function
ex. return from a standard function is ret while from a interupt iret


This topic is closed to new replies.

Advertisement