www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/03/08:19:26

Date: Mon, 3 Mar 1997 14:17:32 +0100 (MET)
From: Christoph Kukulies <kuku AT gil DOT physik DOT rwth-aachen DOT de>
Message-Id: <199703031317.OAA11566@gil.physik.rwth-aachen.de>
To: djgpp AT delorie DOT com
Subject: dpmi_int - any caveats?

Environment: DJGPP V2.01 CWSDPMI V0.90 (r3)

As posted already earlier I'm trying to communicate with
a driver for a stepper motor assembly which runs as a TSR in real mode.
I read djgppfaq.txt chapter 18.2 and as a result I thought I
had it working but the combo of my program and the driver
seems to be very unstable. I cannot invoke the program twice.
Running make after I ran my program causes the machine to lock
and all such mysterious things are happening. Also the driver
doesn't seem to respond always in the same manner.

Anyway, here is the piece of code showing how I access the driver:

The crucial function seems to be the one where I have to pass
the offset in cx and the segment in bx. Every other invocation
which is not passed an address seems to work fine.

      		r.x.ax=24;   /* a function code for the driver */
      		r.x.cx=__tb&0x0f; /* offset */
      		r.x.bx=(__tb>>4)&0xffff;  /* segment */
		dpmi_int(0x78,&r);

BTW, why is __tb>>4 anded with 0xffff? Since it is an address below 1MB
supplied by go32 the by 4 shifted value can never have any bits set
that would be masked off by 0xffff.

I asked the company who is supplying the driver and they say
they save any registers used by the driver.

Does it matter whether cwsdpmi is loaded once in autoexec (cwsdpmi -p)
or having it just in the path?


--
Chris Christoph P. U. Kukulies kuku AT gil DOT physik DOT rwth-aachen DOT de

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019