delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/05/29/01:40:46

From: "FYS" <zfysz AT cybertrails DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1020526082845 DOT 26497F-100000 AT is>
Subject: Re: [bug] delay() doesn't work under WinXP
Lines: 85
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <FxYI8.53477$Kp.5506018@bin7.nnrp.aus1.giganews.com>
NNTP-Posting-Date: Tue, 28 May 2002 23:11:17 CDT
Organization: Giganews.Com - Premium News Outsourcing
X-Trace: sv3-4Y575ARXPyailJBehGfN79wOWZ144oyKm26m/d5ItLJFFzQQpy38b2SvfBNWZJbxp15WZTcQku49+0C!KKl74nvbksGTJ6J/BSxrpBFxXBvNQNFsCHh/3tNdsKgBBdxdQZp83wXbsqEzwqwSIOysbch6Z8AH!DsAXw5zi25behzBK
X-Complaints-To: abuse AT GigaNews DOT Com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
Date: Wed, 29 May 2002 04:11:17 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi TIA,

I don't believe it is the code, (though I did not try it).

I have a Phoenix BIOS ver 4.0 rel 6.0 Laptop and the BIOS
does not support this function.

Since Mario is running WinXP, I would bet it is a new
machine.

Mario, go into a TRUE DOS environment on that machine.
(You will have to find a DOS boot disk to do so)

Then try the code below in a 16-bit DOS compiler.

I would bet it is the BIOS.

TIA, I had this same problem with this service in assembly
a while back.  I booted to a DOS 5.0 disk on the above
mentioned machine and the service did not delay.  However,
the carry was clear and AH was 00h.

The same code works on an older machine with a different
BIOS manufacturer.

Mario, try your "unmodified" code on a different, older
machine.

Hope this helps in the fix,

Ben

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Forever Young Software
http://www.cybertrails.com/~fys/index.htm
To reply by email, please remove the zzzzzz's

Batteries not included,
Some assembly required.


"Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> wrote in message
news:Pine DOT SUN DOT 3 DOT 91 DOT 1020526082845 DOT 26497F-100000 AT is...
>
> 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 -


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