CALLHMA - 3


(char far*)move_d.SourceOffset = (char far*)testmsg;

move_d.DestHandle = (short)handle;

move_d.DestOffset = 0L;

rc = XMM_MoveExtended(&move_d);

if(rc < 0)

error("Copy in EMB error",rc);

move_d.Length = strlen(testmsg) + 1;

move_d.DestHandle = 0;

(char far*)move_d.DestOffset = (char far*)buf;

move_d.SourceHandle = (short)handle;

move_d.SourceOffset = 0L;

rc = XMM_MoveExtended(&move_d);

if(rc < 0)

error("Copy from EMB error",rc);

//

printf("\n%s",buf);

// EMB

rc = XMM_FreeExtended((unsigned)handle);

if(rc)

error("Free XMB error",rc);

return 0;

}

//

//

void error(char *msg, long rc)

{

rc = (unsigned char)(rc >> 24) ;

printf("\n%s, error: %02.2X\n",

msg, (unsigned char)rc);

exit(-1);

}

11.3. callhma\hma.asm

; =====================================================

;

; XMS .

; Small

;

; (C) A. Frolov, 1997

;

; E-mail: frolov@glas.apc.org

; WWW: http://www.glasnet.ru/~frolov

; or

; http://www.dials.ccas.ru/frolov

; =====================================================

.model small

.DATA

;

; XMM

XMM_Control dd ?

.CODE

;

;

c_begin macro

push bp

mov bp,sp

push si

push di

endm

c_end macro

pop di

pop si

mov sp,bp

pop bp

ret

endm

; public

public _XMM_Installed

public _XMM_Version

public _XMM_RequestHMA

public _XMM_ReleaseHMA