[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
        Q:      I don't know assembler, so what can a guy do?

        A:      Well, you could learn it, but for most people, that's
        just not a viable option, since it does take a while.  But, you
        won't have to, because provided here in this special chapter of
        the FAQ is a function called (very cleverly):

                call_driver()

        Call_driver() is an assembly language "wrapper" function, just
        like the undocumented function Interrupt().  In order to use it,
        you should know something about assembly language, mainly; what
        registers are, and what they do.  If you don't, don't bother,
        because I've also provided FORCE wrapper functions around the
        Call_Driver() function, which allow you to access XMS memory in
        a more readable, higher-level interface.  But, let's take a look
        at the Call_Driver() function just for reference.  It's prototype
        looks like this:

        FUNCTION LOGICAL call_driver PROTOTYPE
           PARAMETERS VALUE LONG drv_address,;
                UINT ax,         UINT bx,;
                UINT cx,         UINT dx,;
                UINT si,         UINT di,;
                UINT bp,         UINT ds,;
                UINT es

        If you know assembler, you'll see that all the 8086 registers
        (with the exceptions SS, SP, CS, and IP) are passed in as
        parameters.  Of course, they're not really the registers, but
        their values are loaded into the corresponding registers before
        the driver is called.  If you load up the registers like so:

                VARDEF
                        UINT    ax,bx,cx,dx,si,di,bp,ds,es
                ENDDEF

                ax = 0x0800     && Service for querying available XMS


        You can call the driver with the register AX being 0x0800.

                call_driver( xms_get_driver(), ax, bx, cx, dx, si, di,;
                             bp, ds, es )

        The specifications for the XMS driver are such that for this
        function, "return available extended memory in Kilobytes," the
        available XMS will come back in DX.

        So, after the call to Call_driver(), you can look at your DX
        variable to see how much XMS memory there is.

        Simple as that.  You'll find that the call_driver() function
        mimics the Interrupt() function finally documented in UNDOC.FAQ.

        ------------------------------------------------------------------

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson