;/* ---------------------------------------------------------
;** Library of C-callable assembly functions for common tasks
;** ---------------------------------------------------------
;** Written by John Tsiombikas (Nuclear / the Lab)
;** include the file common.asm (this file) in the C program
;** and assemble with NASM
;** ---------------------------------------------------------
;*/

; /* C declarations */
; void memset32(void *dest, unsigned long value, unsigned long size);

; /* Assembly code
global memset32
memset32:
        pushad
        mov ebp, esp
        mov edi, [ebp + 8]
        mov eax, [ebp + 12]
        mov ecx, [ebp + 16]
        shr ecx, 2
        rep stosd
        mov esp, ebp
        popad
        ret

; */