	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	_calloc]
;
; Line 5:	{
;
_calloc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
;
; Line 6:		unsigned size = numelms * elmsize;
;
	MOV	ESI,DWORD [EBP+08H]
	IMUL	ESI,DWORD [EBP+0CH]
;
; Line 8:		pos = malloc(size);
;
	PUSH	ESI
	CALL	_malloc
	POP	ECX
	MOV	EBX,EAX
;
; Line 9:		if (pos)
;
	TEST	EBX,EBX
	JE	NEAR	L_1
;
; Line 10:			memset(pos,0,size);
;
	MOV	EAX,00H
	MOV	ECX,ESI
	PUSH	EDI
	PUSH	EAX
	MOV	EDI,EBX
	CLD
	REPNZ	STOSB
	POP	EAX
	POP	EDI
L_1:
;
; Line 11:		return pos;
;
	MOV	EAX,EBX
L_3:
	POP	ESI
	POP	EBX
	POP	EBP
	RET


SECTION _TEXT
[EXTERN	_malloc]
