Mail Archives: djgpp/2002/05/26/01:36:13
On Sat, 25 May 2002, Mario Feldberg wrote:
> The delay() function (from dos.h) doesn't seem
> to work under WinXP. There's no delay.
Thanks for the report.
Could you please investigate this a little more? The full source of the
DJGPP implementation of `delay' is attached below; could you please paste
this code into your program, and then add some print-outs inside the
loop to help use understand what goes wrong with that code?
TIA
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <dos.h>
#include <dpmi.h>
void delay(unsigned msec)
{
__dpmi_regs r;
while (msec)
{
unsigned usec;
unsigned msec_this = msec;
if (msec_this > 4000)
msec_this = 4000;
usec = msec_this * 1000;
r.h.ah = 0x86;
r.x.cx = usec>>16;
r.x.dx = usec & 0xffff;
__dpmi_int(0x15, &r);
msec -= msec_this;
}
}
- Raw text -