2 ; Ullrich von Bassewitz, 15.11.2001
4 ; Allocate a block and zero it.
6 ; void* __fastcall__ calloc (size_t count, size_t size);
10 .import _malloc, _memset
11 .import tosumulax, pushax, push0
14 ; -------------------------------------------------------------------------
18 ; We have the first argument in a/x and the second on the stack. Calling
19 ; tosumulax will give the product of both in a/x.
28 ; malloc() is a fastcall function, so we do already have the argument in
33 ; Check for a NULL pointer
40 ; We have a NULL pointer, bail out
44 ; No NULL pointer, clear the block. memset will return a pointer to the
45 ; block which is exactly what we want.
56 ; -------------------------------------------------------------------------