char XMS=0,HMA=0,UMB=0;
void (far *xms)(void);
void get_driver_address()
{
if (XMS)
{
asm {
mov ax,0x4310
int 0x2f
}
xms=(void (far *)())(((long)(_ES)<<16)+_BX);
}
}
typedef struct xms_mov {
unsigned long byte_count; //number of bytes to move
unsigned source_handle; //source handle
unsigned long source_offset; //source offset
unsigned destination_handle; //destination handle
unsigned long destination_offset; //destination offset
} xmm;
xmm xmove;
char move_xms(xmm *xmm_ptr)
{
char error_code=0xff;
if (XMS)
{
unsigned xseg=FP_SEG(xmm_ptr),xoff=FP_OFF(xmm_ptr);
asm {
mov ah,0x0b
mov si,xoff
mov ds,xseg
}
xms();//what does this statement do?
error_code=_BL;
}
return(error_code);
}
When moving conventional memory into extended memory, how is it actually done? What is the purpose of defining this structure? What exactly do registers SI and DS mean here? Do they refer to the offset address and segment base address in extended memory? How exactly is an address in extended memory located? If the amount of data in extended memory is very large, can the 32-bit address in extended memory be accessed through the offset address and segment base address? I hope the experts here can give me some guidance, thanks!
void (far *xms)(void);
void get_driver_address()
{
if (XMS)
{
asm {
mov ax,0x4310
int 0x2f
}
xms=(void (far *)())(((long)(_ES)<<16)+_BX);
}
}
typedef struct xms_mov {
unsigned long byte_count; //number of bytes to move
unsigned source_handle; //source handle
unsigned long source_offset; //source offset
unsigned destination_handle; //destination handle
unsigned long destination_offset; //destination offset
} xmm;
xmm xmove;
char move_xms(xmm *xmm_ptr)
{
char error_code=0xff;
if (XMS)
{
unsigned xseg=FP_SEG(xmm_ptr),xoff=FP_OFF(xmm_ptr);
asm {
mov ah,0x0b
mov si,xoff
mov ds,xseg
}
xms();//what does this statement do?
error_code=_BL;
}
return(error_code);
}
When moving conventional memory into extended memory, how is it actually done? What is the purpose of defining this structure? What exactly do registers SI and DS mean here? Do they refer to the offset address and segment base address in extended memory? How exactly is an address in extended memory located? If the amount of data in extended memory is very large, can the 32-bit address in extended memory be accessed through the offset address and segment base address? I hope the experts here can give me some guidance, thanks!
