NASM - The Netwide Assembler
NASM Forum => Example Code => Topic started by: Structure on January 10, 2020, 06:12:15 PM
-
strcmp:
.cmploop:
mov al, [si]
mov bl, [di]
cmp al, bl
jne .exitstrcmp
cmp al, 0
je .match
inc di
inc si
jmp .cmploop
.exitstrcmp:
clc
jmp retback
ret
.match:
stc
jmp retback
ret
retback:
ret
%macro iff 3
mov si, %1
mov di, %2
call strcmp
jc %3
%endmacro
i.e:
iff string1, string2, gotoLabel
-
Sadly, that only covers iff a==b.
iff covering a complex comparison would be much more useful :)