home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / pc_hw / mem / dmg.txh < prev    next >
Encoding:
Text File  |  1996-01-30  |  875 b   |  38 lines

  1. @node dosmemget, memory
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <sys/movedata.h>
  6.  
  7. void dosmemget(int offset, int length, void *buffer);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function transfers data from MS-DOS's conventional memory space to
  13. the program's virtual address space.  The @var{offset} is a physical
  14. address, which can be computed from a real-mode segment/offset pair as
  15. follows:
  16.  
  17. @example
  18. offset = segment * 16 + offset;
  19. @end example
  20.  
  21. The @var{length} is the number of bytes to transfer, and @var{buffer} is
  22. a pointer to somewhere in your virtual address space (such as memory
  23. obtained from @code{malloc}) where the data will go.
  24.  
  25. @subheading Return Value
  26.  
  27. None.
  28.  
  29. @subheading Example
  30.  
  31. @example
  32. unsigned short shift_state;
  33. dosmemget(0x417, 2, &shift_state);
  34. if (shift_state & 0x0004)
  35.   /* Ctrl key pressed */;
  36. @end example
  37.  
  38.