Author Topic: IFF macro...  (Read 16391 times)

Offline Structure

  • Jr. Member
  • *
  • Posts: 21
IFF macro...
« on: January 10, 2020, 06:12:15 PM »
Code: [Select]

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:
Code: [Select]
  iff string1, string2, gotoLabel

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Re: IFF macro...
« Reply #1 on: January 10, 2020, 10:36:34 PM »
Sadly, that only covers iff a==b.
iff covering a complex comparison would be much more useful :)
My graphics card database: www.gpuzoo.com