Hey... i've got this problem... see:

.data
Pass db "Tsongkie",0
cmd1 dd ?

.code

;some value is assigned to cmd1


i need to compare if cmd1 == offset Pass but somehow it doesnt work... I used

.if cmd1== offset Pass

.endif

What could i been doing wrong? thanks
Posted on 2002-03-17 07:33:06 by Tsongkie[ii]
statement is right,
look in debugger.
Posted on 2002-03-17 07:36:40 by The Svin
maybe you could try:

mov eax, offset Pass
.if cmd1==eax
...
.endif

not sure, yours should work too.:confused:
Posted on 2002-03-17 07:44:44 by Vom-bonjour:-()
I have also tried

mov eax, offset Pass
.if cmd1==eax
.endif

still no luck :(

is it ok even if cmd1 is dd and Pass is a null terminated string... i dunno...
Posted on 2002-03-17 08:03:46 by Tsongkie[ii]
Try this:
include(lib) debug.(inc/lib)

PrintHex cmd1

What value does it give you?
Posted on 2002-03-17 08:06:30 by Thomas
Yeah, it's ok, because you compare 2 dd values.
But do you want that, or do you want to compare 2 strings ??
Posted on 2002-03-17 08:06:46 by Vom-bonjour:-()
Thomas:
Thanks, i'll try that when i get home tonight


Von:

I'm trying to compare 2 strings. :) Thanks for the help.
Posted on 2002-03-17 17:50:53 by Tsongkie[ii]
Windows API - lstrcmp. :)
Posted on 2002-03-17 18:06:35 by stryker
Ahh, well thats probably your problem, your code is checking to see if the pointers to the strings are equal. To see if the strings are equal you have to scan through each byte and compare them, here's one method

lea edi,String1
lea esi,String2
mov ecx,SizeOfString
repe cmpsb
jne NotEqual
; Code here if equal
NotEqual:
; COde here if not equal
Posted on 2002-03-17 18:14:24 by Eóin
thanks man ;) That solved everything ;)
Posted on 2002-03-17 18:35:31 by Tsongkie[ii]
hi, i hope i'm not annoying you too much, but can you explain how that code works? thanks a lot. It solved my problem, i just need to know when to use it...
Posted on 2002-03-17 19:01:58 by Tsongkie[ii]
I thought we should be migrating to risc operations? Anyway, I was inspired.

The microcode gets 9+4*n. Does anybody know how
this is done? I have not come close yet.

Tsongkie:

http://oopweb.com/Assembly/Documents/ArtOfAssembly/VolumeFrames.html?/Assembly/Documents/ArtOfAssembly/Volume/Chapter_15/CH15-2.html
Posted on 2002-03-18 00:37:33 by bdjames
For a good explanation of string instructions check out this tutorial by NOPerator.

Indeed check out his entire site. There's lots of great stuff there. :alright:
Posted on 2002-03-18 07:18:21 by Eóin
Thanks a lot man ;)
Posted on 2002-03-18 09:38:56 by Tsongkie[ii]