2 x12_getcmdparaptr function call – Sensoray 512 DOS User Manual
Page 17

17
6.2 X12_GETCMDPARAPTR function call
The X12_GETCMDPARAPTR function obtains a real mode far pointer to the parameter data structure.
A far pointer to the data permits the sending and returning of values to and from the driver pertinent to a
particular command.
Entry:
Register Description Value
SI Function number X11_ GETCMDPARAPTR + either CARD0 for the first
card or CARD1 for the second card.
Exit:
Register Description Value
DX:AX Segment-offset pair
pointer to parameter data.
Example:
#include “x12.h” //Included for 512 dos driver support
#include “dos.h” //Included for software interrupt support
.
.
.
X12PARAM _far *Param; //Declare a pointer to an X12PARAM object
union REGS regs;
.
.
.
regs.x.si = X12_GETCMDPARAPTR + CARD0; //Select the driver function
int86(X12INT,®s,®s); //Call the driver
Param = (X12PARAM _far *) MK_FP(regs.x.dx, regs.x.ax); //Make a pointer from the returned register values