Article View: comp.os.msdos.programmer
Article #1176Borland C++ calling XMS Driver
From: Alan Eldridge
Date: Sun, 30 Aug 1992 16:21
Date: Sun, 30 Aug 1992 16:21
49 lines
1839 bytes
1839 bytes
To: wagner@main.mndly.umn.edu
29 Aug 92, Rick Wagner writes to All:
RW> Set AX=4310h and INT 2F. This will return the address of the XMS
RW> driver in ES:BX. I can call this function with an INT86x and get the
RW> address returned (confirmed) but I can't figure out how to call the XMS
RW> driver at ES:BX. I read the longjump stuff in the manual and I'm now
RW> totally confused.
RW>
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.
2. Take a look at this...
typedef void far (*XF)() = 0;
unsigned short usXMSSeg = 0;
unsigned short usXMSOff = 0;
XF xfXMS = (XF)0;
int GetXMSPtr()
{
_AX=0x4310;
geninterrupt(0x2f);
usXMSOff = _BX;
usXMSSeg = _ES;
xfXMS = (XF)MK_FP(usXMSSeg, usXMSOff);
return xfXMS != 0;
};
// example to call XMS driver with AX set to some value
int XMSCall(unsigned short axval)
{
_AX=axval;
xfXMS();
return _AX;
}
Hope this clears up some of the confusion for you.
Alan
--
Internet: aeldridge@p473.f150.n3603.z1.FIDONET.ORG
UUCP: ...!myrddin!tct!psycho!150.473!aeldridge
Note:psycho is a free gateway between Usenet & Fidonet. For info write to
root@psycho.fidonet.org.
Technical Details
Message-ID:
<25905.2AA2609A@psycho.fidonet.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!sybus.sybus.com!myrddin!tct!psycho!p473.f150.n3603.z1.FIDONET.ORG!aeldridgeShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sybus.sybus.com!myrddin!tct!psycho!p473.f150.n3603.z1.FIDONET.ORG!aeldridge From: aeldridge@p473.f150.n3603.z1.FIDONET.ORG (Alan Eldridge) Sender: ufgate@psycho.fidonet.org (newsout1.24) Newsgroups: comp.os.msdos.programmer Subject: Borland C++ calling XMS Driver Message-ID: <25905.2AA2609A@psycho.fidonet.org> Date: Sun, 30 Aug 92 12:21:08 EDT Organization: FidoNet node 1:3603/150.473 - Carrie's Living Roo, Largo FL Lines: 49