home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8933 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.7 KB

  1. Path: sparky!uunet!sybus.sybus.com!myrddin!tct!psycho!p473.f150.n3603.z1.FIDONET.ORG!aeldridge
  2. From: aeldridge@p473.f150.n3603.z1.FIDONET.ORG (Alan Eldridge)
  3. Sender: ufgate@psycho.fidonet.org (newsout1.24)
  4. Newsgroups: comp.os.msdos.programmer
  5. Subject: Borland C++ calling XMS Driver
  6. Message-ID: <25905.2AA2609A@psycho.fidonet.org>
  7. Date: Sun, 30 Aug 92 12:21:08 EDT
  8. Organization: FidoNet node 1:3603/150.473 - Carrie's Living Roo, Largo FL
  9. Lines: 49
  10.  
  11. To: wagner@main.mndly.umn.edu
  12.  
  13. 29 Aug 92, Rick Wagner writes to All:
  14.  
  15.  RW> Set AX=4310h and INT 2F.  This will return the address of the XMS
  16.  RW> driver in ES:BX.  I can call this function with an INT86x and get the
  17.  RW> address returned (confirmed) but I can't figure out how to call the XMS
  18.  RW> driver at ES:BX.  I read the longjump stuff in the manual and I'm now
  19.  RW> totally confused.
  20.  RW>
  21.  
  22. 1. Longjmp() has got nothing to do with this... it is for unwinding the stack after a failed operation 57 function calls deep or for switching tasks in pseudo-multitaskers.
  23.  
  24. 2. Take a look at this...
  25.  
  26. typedef void far (*XF)() = 0;
  27.  
  28. unsigned short  usXMSSeg = 0;
  29. unsigned short  usXMSOff = 0;
  30. XF              xfXMS = (XF)0;
  31.  
  32. int GetXMSPtr()
  33. {
  34.         _AX=0x4310;
  35.         geninterrupt(0x2f);
  36.         usXMSOff = _BX;
  37.         usXMSSeg = _ES;
  38.         xfXMS = (XF)MK_FP(usXMSSeg, usXMSOff);
  39.         return xfXMS != 0;
  40. };
  41.  
  42. // example to call XMS driver with AX set to some value
  43.  
  44. int XMSCall(unsigned short axval)
  45. {
  46.         _AX=axval;
  47.         xfXMS();
  48.         return _AX;
  49. }
  50.  
  51. Hope this clears up some of the confusion for you.
  52.  
  53. Alan
  54.  
  55. --  
  56. Internet: aeldridge@p473.f150.n3603.z1.FIDONET.ORG
  57. UUCP: ...!myrddin!tct!psycho!150.473!aeldridge
  58. Note:psycho is a free gateway between Usenet & Fidonet. For info write to
  59.      root@psycho.fidonet.org.
  60.