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

  1. @node dosmemgetb, memory
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <sys/movedata.h>
  6.  
  7. void _dosmemgetb(unsigned long offset, size_t xfers, void *buffer);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function transfers data from MS-DOS's conventional memory space
  13. to the program's virtual address space, using only byte transfers.
  14. The @var{offset} is a physical address, which can be computed from a
  15. real-mode segment/offset pair as follows:
  16.  
  17. @example
  18. offset = segment * 16 + offset;
  19. @end example
  20.  
  21. The @var{xfers} 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. dosmemgetb(0x417, 2, &shift_state);
  34. if (shift_state & 0x0004)
  35.   /* Ctrl key pressed */;
  36. @end example
  37.  
  38.