home *** CD-ROM | disk | FTP | other *** search
- #include <dos.h>
-
- delay(unsigned msec)
- {
- union REGS r;
- while (msec)
- {
- int usec;
- int msec_this = msec;
- if (msec_this > 4000)
- msec_this = 4000;
- usec = msec_this * 1000;
- r.h.ah = 0x86;
- r.x.cx = (usec>>16) & 0xffff;
- r.x.dx = usec & 0xffff;
- int86(0x15, &r, &r);
- msec -= msec_this;
- }
- }
-