News:

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

GetFilePath

Started by Vortex, December 06, 2006, 06:22:51 PM

Previous topic - Next topic

Grincheux

Thanks Vortex.

Here is my last test from RamGuru :

eax = 98,  cycles
file = C:\WINDOWS\system32\drivers\etc\hosts
path = C:\WINDOWS\system32\drivers\etc\
----------------------------------------
eax = 587,  ms
----------------------------------------

I stop now, I have work to do...
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

Grincheux

Last try :

QuoteGrincheuxGetFilePath proc sour:DWORD, dest:DWORD

      push   edi
      push   esi

      mov      eax,'\\\\'
      mov      esi,sour
      mov      edi,dest
      mov      al,Byte Ptr [esi]
      mov      edx,1

@@ :

      test   al,al
      jz      @NextLoop

         add      esi,edx
         mov      Byte Ptr [edi],al
         add      edi,edx

         mov      al,Byte Ptr [esi]
         jmp      @B

@@ :

      cmp    al,ah
      jz     @EndOfJob

@NextLoop :

         sub      edi,edx
         nop
         mov      al,Byte Ptr [edi]
         jmp      @B

@EndOfJob :

      mov      Byte Ptr [edi],0

@Exit :

      pop      esi
      pop      edi

      ret
GrincheuxGetFilePath endp

file = C:\WINDOWS\system32\drivers\etc\hosts
path = C:\WINDOWS\system32\drivers\etc
----------------------------------------
eax = 95,  cycles
eax = 580,  ms
----------------------------------------

I really stop now.
Good Night
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

ramguru

#47
I got some really strange results using Agner Fog timer routines (TSCWin.zip):
Used 50 bytes path

; put your test code here. Example:

        REPT 100          ; repeat code 100 times
invoke GetFilePath...
        ENDM



30492 Vortex_v1
44604 Vortex_v2
17904 ramguru
18192 Grincheux_v1
18384 Grincheux_v2
1020  Lingo ....sorry I mixed push parameters 21480

Now who's timer routine is more trustful?! Michael's | Agner's

Grincheux

Here is what I use for measuring cycles :

Quotecounter_begin 10000000, REALTIME_PRIORITY_CLASS
      invoke   GrincheuxGetFilePath,ADDR file,ADDR path
   counter_end

   push   eax
    PrintString   file
    PrintString   path
    PrintLine
    pop      eax

    PrintDec   eax," cycles"

    timer_begin 10000000, REALTIME_PRIORITY_CLASS
      invoke   GrincheuxGetFilePath,ADDR file,ADDR path
    timer_end

    PrintDec   eax," ms"
    PrintLine
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz