	SECTION _TEXT CLASS=CODE USE32
	SECTION _DATA CLASS=DATA USE32
	SECTION _BSS  CLASS=BSS USE32
	SECTION _CONST  CLASS=CONST USE32
	SECTION _STRING  CLASS=STRING USE32
	SECTION cstartup CLASS=INITDATA USE32
	SECTION crundown CLASS=EXITDATA USE32
	SECTION cppinit  CLASS=CPPINIT USE32
	SECTION cppexit  CLASS=CPPEXIT USE32
	GROUP DGROUP _DATA _BSS _CONST _STRING

SECTION _TEXT
[GLOBAL	__ll_malloc]
;
; Line 11:	{
;
__ll_malloc:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
;
; Line 14:	  if (dpmi_get_memory(&address, &handle, (size+sizeof(DPMI_MEM_HANDLE) + 4095) & -4096)) {
;
	MOV	EAX,DWORD [EBP+08H]
	ADD	EAX,01003H
	AND	EAX,0FFFFF000H
	PUSH	EAX
	LEA	EAX,[EBP+0FFFFFFF8H]
	PUSH	EAX
	LEA	EAX,[EBP+0FFFFFFFCH]
	PUSH	EAX
	CALL	_dpmi_get_memory
	ADD	ESP,BYTE 0CH
	TEST	EAX,EAX
	JE	SHORT	L_1
;
; Line 15:			errno = _dos_errno = 8       ;
;
	MOV	DWORD [__dos_errno],08H
	MOV	DWORD [_errno],08H
;
; Line 16:			return 0;
;
	MOV	EAX,00H
	JMP	L_3
L_1:
;
; Line 18:		address -= _linear;
;
	MOV	EAX,DWORD [__linear]
	SUB	DWORD [EBP+0FFFFFFFCH],EAX
;
; Line 19:		*(DPMI_MEM_HANDLE *)address = handle;
;
	MOV	EAX,DWORD [EBP+0FFFFFFFCH]
	MOV	ECX,DWORD [EBP+0FFFFFFF8H]
	MOV	DWORD [EAX+00H],ECX
;
; Line 20:		return (void *) (address + sizeof(DPMI_MEM_HANDLE));
;
	MOV	EAX,DWORD [EBP+0FFFFFFFCH]
	ADD	EAX,BYTE 04H
L_3:
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_free]
;
; Line 24:	{
;
__ll_free:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
;
; Line 26:		handle = *(((DPMI_MEM_HANDLE *) block) -1);
;
	MOV	EAX,DWORD [EBP+08H]
	SUB	EAX,BYTE 04H
	MOV	EBX,DWORD [EAX+00H]
;
; Line 27:		dpmi_free_memory(handle);
;
	PUSH	EBX
	CALL	_dpmi_free_memory
	POP	ECX
;
; Line 28:	}
;
	POP	EBX
	POP	EBP
	RET


SECTION _TEXT
[EXTERN	_dpmi_free_memory]
[EXTERN	_dpmi_get_memory]

SECTION _DATA
[EXTERN	__linear]
[EXTERN	__dos_errno]
[EXTERN	_errno]
