[comp.sys.ibm.pc] int86

rwmira01@ULKYVX.BITNET (Rob Miracle) (04/14/89)

I have ran into what I consider a bug (at least a lack of documentation) with
int86() and Turbo C 2.0.

Consider this:

#include <dos.h>
main() {
  union REGS regs;

  regs.h.ah = 0;
  int86(0x2A,&regs,&regs);
  if(regs.h.ah != 0) puts("NETBIOS Present"\n);
  else puts("NETBIOS Absent\n");
}

This little code segment executes interrupt 2A.  If it returns a 0 then NETBIOS
isn't installed.

Under DOS 3.2 and DOS 3.3 this works fine.  Under DOS 2.11 it locks up the
machine.  What I think is happening is if you do a getvect() on an interrupt
that does not exist it returns NULL (0000:0000).  It would appear that int86
blindly executes the interrupt and goes off to no where.  I guess that under
DOS 2.11 that vector is unused and NETBIOS sets it up and that under the 3.x
series it at least vectors to an iret instruction.

Rob

Rob Miracle              | Bitnet   : RWMIRA01@ULKYVX    CIS: 74216,3134
Programmer/Analyst-II    | INTERNET : rwmira01%ulkyvx.bitnet@cunyvm.cuny.edu
University of Louisville | UUCP     : ...psuvax1!ulkyvx.bitnet!rwmira01