Mail Archives: djgpp/1997/07/26/05:18:44
From: | Chris Frolik <frolikcc AT indy DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | __dpmi_int
|
Date: | Fri, 25 Jul 1997 15:18:13 -0500
|
Organization: | IndyNet - Indys Internet Gateway (info AT indy DOT net)
|
Lines: | 76
|
Message-ID: | <33D90A05.48E6@indy.net>
|
NNTP-Posting-Host: | ip75-195.ts.indy.net
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I am writing (or trying to write) a program in DJGPP which uses IPX
protocol through the Internet. This protocol uses the interrupt 0x7A
from the IPX driver.
The code which defines a block of data to be sent/recieved is as
follows:
/**************************************************
BEGIN code fragment
***************************************************/
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long LONG;
typedef struct ECBFragment {
void far *address;
WORD size;
}ECBFragment;
typedef struct ECB {
void far *linkAddress;
void (far *ESRAddress)();
BYTE InUseFlag;
BYTE CompletionCode;
WORD SocketNumber; //Big-Endian
BYTE IPXWorkspace[4];
BYTE DriverWorkspace[12];
BYTE ImmediateAddress[6];
WORD FragmentCount;
ECBFragment FragmentDescriptor[4];
}ECB;
/*********************************************
The function which uses this code follows:
**********************************************/
int IPXListenForPacket(ECB *ecb)
{
BYTE rvalue1;
short ECBSEG,ECBOFS;
ECBSEG=FP_SEG(ecb);
ECBOFS=FP_OFF(ecb);
asm {
mov si,ECBOFS;
mov es,ECBSEG;
mov bx,4;
int 0x7a;
mov rvalue1,al;
}
if (rvalue1) return 1;
else return 0;
}
/*******************************************
END code fragment
********************************************/
This code fragment executes function 4 of interrupt 0x7A, which requires
ES:SI to point to the ECB structure.
I know that the inline asm here is not compatable with DJGPP, but that
is not the problem, since it can be converted. The problem is with the
FP_SEG and FP_OFF macros, as DJGPP does not define these.
I have read the FAQ on this, and I think I need to use __dpmi_int or
__dpmi_simulate_real_mode_interrupt. My question is, how do i get the
segment of the ecb pointer into ES, and how do i get the offset into SI
(not the actual registers, but the approprate variables in the REGS
struct). I thought I could use the int86 function, but that is only for
standard DOS/BIOS routines.
Also, do I need the __dpmi_int or __dpmi_simulate_real_mode_interrupt
function in this case?
Thanks,
-Chris
- Raw text -