home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / isdesq.asm < prev    next >
Assembly Source File  |  1993-10-14  |  2KB  |  82 lines

  1. ;  File......: ISDESQ.ASM
  2. ;  Author....: David Pearson
  3. ;  BBS.......: The Dark Knight Returns
  4. ;  Net/Node..: 050/069
  5. ;  User Name.: Dave Pearson
  6. ;  Date......: 23/03/93
  7. ;  Revision..: 1.0
  8. ;
  9. ;  This is an original work by Dave Pearson and is placed in the public
  10. ;  domain.
  11. ;
  12. ;  Modification history:
  13. ;  ---------------------
  14. ;
  15. ;  $Log$
  16. ;
  17. ;
  18. ;
  19. ;   $DOC$
  20. ;   $FUNCNAME$
  21. ;       GT_ISDESQ()
  22. ;   $CATEGORY$
  23. ;       Environment
  24. ;   $ONELINER$
  25. ;       Check if application is running under DesqView
  26. ;   $SYNTAX$
  27. ;       GT_IsDesq() --> lIsDesqView
  28. ;   $ARGUMENTS$
  29. ;       None
  30. ;   $RETURNS$
  31. ;       A Logical value.
  32. ;   $DESCRIPTION$
  33. ;       GT_IsDesq() can be used to see if your application is running
  34. ;       under DesqView.
  35. ;   $EXAMPLES$
  36. ;       if GT_IsDesq()
  37. ;          ? "Running under DesqView"
  38. ;       endif
  39. ;   $END$
  40. ;
  41.         IDEAL
  42.  
  43. Public  GT_ISDESQ
  44.  
  45. Extrn   __RetL:Far
  46.  
  47. Segment GtLibrary       Word    "CODE"
  48.         Assume          CS:GtLibrary
  49.  
  50. Proc    GT_ISDESQ       Far
  51.  
  52.         Push    BP              ; Save registers.
  53.         Mov     BP,SP
  54.         Push    DS
  55.         Push    ES
  56.         Push    SI
  57.         Push    DI
  58.  
  59.         Mov     AX,2B01h        ; DOS Set Time Service.
  60.         Mov     CX,'DE'         ; We check for DesqView by trying to set the
  61.         Mov     DX,'SQ'         ; time to `DESQ'.
  62.         Int     21h             ; Call DOS.
  63.         And     AX,0FFh         ; Mask AX for the FFh that DOS would return.
  64.         Sub     AX,0FFh         ; Swap the value of AX ready for __RetL.
  65.         Push    AX              ; Push AX onto stack for return.
  66.         Call    __RetL          ; Return logical value back to Clipper.
  67.         Add     SP,2            ; Reset the stack pointer.
  68.  
  69.         Pop     DI              ; Restore registers.
  70.         Pop     SI
  71.         Pop     ES
  72.         Pop     DS
  73.         Pop     BP
  74.  
  75.         Ret
  76.  
  77. EndP    GT_ISDESQ
  78.  
  79. EndS    GtLibrary
  80.  
  81. End
  82.