flat assembler
Message board for the users of flat assembler.

Index > Windows > lstrcat replacement

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
marcinzabrze12



Joined: 07 Aug 2011
Posts: 61
marcinzabrze12 09 Dec 2012, 17:15
other hand. I used now DLL version of library STRING.INC and wrote code to display clock counter like this:

Code:
format pe gui 4.0
entry start
include 'win32ax.inc'

section '.code' code readable writeable executable

                stringa         db  'JakiStam LaNCUCH ZnakOw', 0
                stringb         db  'JakiStam LaNCUCH ZnakOw', 0

                timer1:         dq      ?
                timer2:         dq      ?

                txbuffer:       db      400h    dup 0

start:

                invoke  QueryPerformanceCounter, timer1
;               ---------------------------------------
                invoke  lstrcmp, stringa, stringb    ;/  invoke  ansiCmp, stringa, stringb
;               ---------------------------------------
                invoke  QueryPerformanceCounter, timer2
;               ---------------------------------------
                mov     eax, [timer1]
                mov     ebx, [timer2]
                sub     ebx, eax
                cinvoke wsprintf, txbuffer, <'TIME:  %0.8d',13,10>, EBX
                invoke  MessageBox, 0, txbuffer, 'result:', 0
;               ---------------------------------------
                ret    




section '.idata' import data readable
library kernel32, 'kernel32', user32, 'user32', string, 'NOAPI_STRING.DLL'
include  'api\kernel32.inc'
include  'api\user32.inc'
import   string,\
                ansiLength,             'ansiLength',\
                unicodeLength,          'unicodeLength',\
                ansiCopy,               'ansiCopy',\
                unicodeCopy,            'unicodeCopy',\
                ansiCat,                'ansiCat',\
                unicodeCat,             'unicodeCat',\
                ansiCmp,                'ansiCmp',\
                ansiCmpx,               'ansiCmpx',\
                unicodeCmp,             'unicodeCmp',\
                unicodeCmpx,            'unicodeCmpx',\
                ansiToBig,              'ansiToBig',\
                ansiToSmall,            'ansiToSmall',\
                unicodeToBig,           'unicodeToBig',\
                unicodeToSmall,         'unicodeToSmall',\
                unicodeToAnsi,          'unicodeToAnsi',\
                ansiToUnicode,          'ansiToUnicode'

                                                             
    


Its shows that lstrcmp is about 100x slower than ansiCmp. Or may be i wrong way test time execution ?

EDIT: i uploaded dll version of STRING.INC file if someone want to test it:


Description: Dll version of STRING.INC + source
Download
Filename: STRING DLL PROJECT.rar
Filesize: 4.1 KB
Downloaded: 195 Time(s)

Post 09 Dec 2012, 17:15
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.