#pragma once

//#ifndef __DPMI_H
//#define __DPMI_H

#ifdef __WATCOMC__
#pragma library("system.lib")
#endif

#ifdef __cplusplus
extern "C" {
#endif
//---------------------------------------------------------------------------//
#include "system/xstddef.h"

typedef struct s_RMREGS RMREGS;

int _dpmi_dosalloc( DWORD bytes, WORD *selector, WORD *segment);
void _dpmi_dosfree( WORD segment);
void *_dpmi_mapmem( void *pointer, DWORD length);
void _dpmi_realmodeint( BYTE intnum, RMREGS *regs);

struct s_RMREGS
{
	union
	{
		DWORD edi;
		WORD di;
	};
	union
	{
  	DWORD esi;
  	WORD si;
	};
	union
	{
  	DWORD ebp;
  	WORD bp;
	};
	union
	{
  	DWORD edp;
  	WORD dp;
	};
	union
	{
  	DWORD ebx;
  	WORD bx;
	};
	union
	{
  	DWORD edx;
  	WORD dx;
	};
	union
	{
  	DWORD ecx;
  	WORD cx;
	};
	union
	{
  	DWORD eax;
  	WORD ax;
	};
  WORD flags;
  WORD es,ds,fs,gs,ip,cs,sp,ss;
};

//---------------------------------------------------------------------------//
#ifdef __cplusplus
}
#endif
//#endif
