News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Faster IsEqualGUID

Started by jdoe, December 10, 2007, 04:13:30 AM

Previous topic - Next topic

jdoe

Not really impressive, but this function replaces IsEqualGUID which comes from ole32.dll
Just for the pleasure of making different. The attachment shows the speed enhancement.


OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

ALIGN 16

NOP
NOP

;
; Compares one GUID to another
;
; Returns non-zero if equal
;
; p_lpGUID1 = Pointer to the first GUID
; p_lpGUID2 = Pointer to the second GUID
;
AzmtIsEqualGUID PROC p_lpGUID1:DWORD, p_lpGUID2:DWORD

    mov eax, [esp+4]
    mov ecx, [esp+8]

    mov edx, dword ptr [eax]
    cmp dword ptr [ecx], edx
    jne @F

    mov edx, dword ptr [eax+4]
    cmp dword ptr [ecx+4], edx
    jne @F

    mov edx, dword ptr [eax+8]
    cmp dword ptr [ecx+8], edx
    jne @F

    mov edx, dword ptr [eax+12]
    cmp dword ptr [ecx+12], edx
    jne @F

    ret 8

@@:

    xor eax, eax

    ret 8

AzmtIsEqualGUID ENDP

OPTION PROLOGUE:PROLOGUEDEF
OPTION EPILOGUE:EPILOGUEDEF




[attachment deleted by admin]