home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / NFSRC305.ZIP / ASM / IAMIDLE.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-05-01  |  1.9 KB  |  79 lines

  1. ; File......: ADAPTER.ASM
  2. ; Author....: Ted Means
  3. ; CIS ID....: 73067,3332
  4.  
  5. ; This is an original work by Ted Means and is placed in the
  6. ; public domain.
  7. ;
  8. ; Modification history:
  9. ; ---------------------
  10. ;
  11. ;     Rev 1.0   01 Jan 1995 03:01:00   TED
  12. ;  Nanforum Toolkit
  13. ;
  14.  
  15. ;  $DOC$
  16. ;  $FUNCNAME$
  17. ;     FT_IAmIdle()
  18. ;  $CATEGORY$
  19. ;     DOS/BIOS
  20. ;  $ONELINER$
  21. ;     Inform the operating system that the application is idle.
  22. ;  $SYNTAX$
  23. ;     FT_IAmIdle() -> lSuccess
  24. ;  $ARGUMENTS$
  25. ;     None
  26. ;  $RETURNS$
  27. ;     .T. if supported, .F. otherwise.
  28. ;  $DESCRIPTION$
  29. ;     Some multitasking operating environments (e.g. Windows or OS/2) can
  30. ;     function more efficiently when applications release the CPU during
  31. ;     idle states.  This function allows you "announce" to the operating
  32. ;     system that your application is idle.
  33. ;
  34. ;     Note that if you use this function in conjunction with FT_OnIdle(),
  35. ;     you can cause Clipper to automatically release the CPU whenever
  36. ;     Clipper itself detects an idle state.
  37. ;  $EXAMPLES$
  38. ;     while inkey() != K_ESC
  39. ;        FT_IAmIdle()         // Wait for ESC and announce idleness
  40. ;     end
  41. ;
  42. ;     * Here's another way to do it:
  43. ;
  44. ;     FT_OnIdle( {|| FT_IAmIdle()} )
  45. ;
  46. ;     Inkey( 0 )              // Automatically reports idleness until key
  47. ;                             // is pressed!
  48. ;  $SEEALSO$
  49. ;     FT_OnIdle()
  50. ;  $END$
  51. ;
  52.  
  53. IDEAL
  54.  
  55. Public    FT_IAmIdle
  56.  
  57. Extrn     __RetL:Far
  58.  
  59. Segment   _NanFor   Word      Public    "CODE"
  60.           Assume    CS:_NanFor
  61.  
  62. Proc      FT_IAmIdle          Far
  63.  
  64.           Mov       AX,1680h
  65.           Int       2Fh
  66.  
  67.           Mov       DX,1
  68.           Or        AL,AL
  69.           JZ        @@Done
  70.           Dec       DX
  71.  
  72. @@Done:   Push      DX
  73.           Call      __RetL
  74.           Add       SP,2
  75.  
  76.           RetF
  77. Endp      FT_IAmIdle
  78. Ends      _NanFor
  79. End