🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1552

More "Far Call in C"

#1552
From: saunders
Date: Mon, 09 Jul 1990 19:59
32 lines
2002 bytes
   MSDOS/8086 gurus:

   Thanks for the responses.  Alas, most weren't what I needed.  I'll come
clean right away: I am totally incompetent at 8086 assembly language!  The
Novell IPX/SPX and Microsoft XMS interfaces are CALLed, but with parms in
the registers.  Sort of a cross between a normal function call and a DOS
"int 21h" call.  Both IPX/SPX and XMS hook into "multiplex interrupt" 2fh
and return their main address for the API (damn all these TLAs!) in ES:DI
or ES:BX.  Then, Joe-Assembly-Programmer would just store the result 
someplace and make indirect jumps through it.  Here is an example from the
XMS docs:

         mov   ax,4310h                    ; XMS int 2fh signiture
         int   2Fh
         mov   word ptr [XMSControl],bx    ; XMSControl is a DWORD
         mov   word ptr [XMSControl+2],es
         ; We now have the XMS API entry point
         ; then we'de call an XMS function like this:
         mov   ah,00h      ; function code for "Get XMS version number"
         call  [XMSControl]

   Notice how weird that is.  It's neither a int86() call nor a normal
function call.  What I need is a general-purpose routine kind of like
int86x(), but I'm unable to write one.  e.g.
    void farcall(void far *api_entry, 
                 union REGS regstuff,
                 struct SREGS sregstuff);
   I hear some of the mega-optimizing compilers have ways of declaring
functions that take register parms, but I need something for MIX or MSC.

      -- Rich Saunders
Technical Details
Message-ID: <1990Jul9.195959.13596@ariel.unm.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mephisto!ncar!unmvax!ariel.unm.edu!hydra.unm.edu!saunders

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mephisto!ncar!unmvax!ariel.unm.edu!hydra.unm.edu!saunders
From: saunders@hydra.unm.edu
Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.programmer,alt.msdos.programmer
Subject: More "Far Call in C"
Message-ID: <1990Jul9.195959.13596@ariel.unm.edu>
Date: 9 Jul 90 19:59:59 GMT
Sender: usenet@ariel.unm.edu (USENET News System)
Distribution: na
Organization: University of New Mexico, Albuquerque
Lines: 32