TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: David Noon
from: mark lewis
date: 1996-12-08 18:12:08
subject: Magic code for DosSleep

ml>>  DN> zero under Warp. It is no longer the number of
ml>>  DN> milliseconds for DN> DosSleep() to suspend the VDM.
ml>>
ml>> "no longer" as in "this is how it was in v2.x but not in
ml>> v3.x and now different again in v4.x" ???  hummm... time to
ml>> start checking the OS version before loading AX and/or
ml>> deciding which call to give up... hummm 

 DN> This is correct. In 2.x it was the number of msec, but in 3.0 the
 DN> AX register must be zero otherwise the call is ignored.

hummm... ok... when i type VER in a dos window and have 2.30 returned, i
_have_ to set AX >= 2 or i get 100% CPU usage with the DOSSLEEP call...
using 2 gives me 0% CPU usage in a "repeat killtime until
keypressed" loop... there are NO fixpacks installed here...

my killtime code (for os/2) now looks like this... yes, Turbo Pascal again :-)

Procedure KillTime;
begin
  if in_os2 then
    case hi(OS2ver) of        {os2ver returns 230 for v2.30}
      2 : asm                 {ver 2.xx as reported by DOS get ver call}
            xor     dx,dx
            mov     ax,2      {sleep for two milliseconds}
            hlt
            db      35h,0CAh
          end;
      3 : asm                 {ver 3.xx as reported by DOS getver call}
            xor     dx,dx
            mov     ax,0      {sleep now}
            hlt
            db      35h,0CAh
          end;
      4 : asm                 {ver 4.xx as reported by DOS getver call}
            xor     dx,dx
            mov     ax,0      {sleep now. temp setting till further testing}
            hlt
            db      35h,0CAh
          end;
    else
      asm
        MOV AX, 1680h    { use DPMI time slice call }
        INT 2Fh
      end;
    end
  else
    {do windows, DV, or DOS idle calls}
end;

what am i missing, if anything??

)\/(ark


* Origin: (1:3634/12)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 3634/12 170/400 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.