RFC-interupt31-sv/restore

Bob Goodwin goodie1 at pacbell.net
Fri May 18 12:32:35 CDT 2001


I have an application that requires the interupt 31 save/restore
function. At this time, that's just a stub in wine. I propose the
following code as a template for a save/restore function. I'm not sure
about the whole thing and would like some help please.
Thanks.

Best regards,
Bob Goodwin

This code is incomplete and has syntax and other errors.

VOID _Int31_SvRestoreHandler()

/* this one is just for INTEL */
#ifdef __386__

/* an array to save the context in */
WORD svctx[];

/* return the address of the SaveRestore function */

/* assembly code to get the function call address of
   SaveRestore() and return the address in the form CX:DX */

VOID SaveRestore()
    {
        _GET_CONTEXT;

        if AL_reg(context) /* AL=1 means restore. AL=0 means save. */
            {
               /* restore all registers */

               AL_reg(context)=svctx[0]; /* actually, eax is volatile */
               AH_reg(context)=svctx[1];
               AL_reg(context)=svctx[2];
               AL_reg(context)=svctx[3];
               AL_reg(context)=svctx[4];
               AL_reg(context)=svctx[5];
               AL_reg(context)=svctx[6];
               AL_reg(context)=svctx[7];
             }
        else
            {
               /* save all registers */

               svctx[0]=AL_reg(context);
               svctx[1]=AH_reg(context);
               svctx[2]=SS_reg(context);
               svctx[3]=SI_reg(context);
               svctx[4]=DL_reg(context);
               svctx[5]=DH_reg(context);
               svctx[6]=CL_reg(context);
               svctx[7]=CH_reg(context);
            }


#endif /* __386__ */



More information about the wine-users mailing list