home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / peekword.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  2KB  |  67 lines

  1. /*
  2.  * File......: PEEKWORD.C
  3.  * Author....: David Pearson
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Dave Pearson
  7.  * Date......: 30/03/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Dave Pearson and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20. #include "GT_Mem.H"
  21. #include <Extend.H>
  22.  
  23. /*
  24.  *  $DOC$
  25.  *  $FUNCNAME$
  26.  *      GT_PEEKW()
  27.  *  $CATEGORY$
  28.  *      Memory
  29.  *  $ONELINER$
  30.  *      Return the contents of a word in memory.
  31.  *  $SYNTAX$
  32.  *      GT_PeekW(<nSegment>,<nOffset>) --> nWord
  33.  *  $ARGUMENTS$
  34.  *      <nSegment> is the segment of the word in memory.
  35.  *
  36.  *      <nOffset> is the offset of the word in memory.
  37.  *  $RETURNS$
  38.  *      The numeric content of the specified word in memory.
  39.  *  $DESCRIPTION$
  40.  *      GT_PeekW() can be used for getting numeric word values from
  41.  *      specific locations in memory.
  42.  *  $EXAMPLES$
  43.  *      // Check if this machine as a floppy drive.
  44.  *
  45.  *      nEquipment := GT_PeekW(^b64,16^B)
  46.  *      if GT_And(nEquipment,1) != 0
  47.  *         ? "Machine has a floppy drive."
  48.  *      else
  49.  *         ? "Machine does not have a floppy drive."
  50.  *      endif
  51.  *  $SEEALSO$
  52.  *      GT_PEEKB()
  53.  *  $END$
  54.  */
  55.  
  56. CLIPPER GT_PeekW()
  57. {
  58.         if (PCOUNT == 2 && ISNUM(1) && ISNUM(2))
  59.         {
  60.                 _retni((unsigned int)_GT_peek(_parnl(1),_parnl(2)));
  61.         }
  62.         else
  63.         {
  64.                 _retni(0);
  65.         }
  66. }
  67.