flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Question with macros and if statements

Author
Thread Post new topic Reply to topic
Meor



Joined: 02 Jan 2006
Posts: 3
Meor
Could anyone take a look at this short macro. For some reason Error equals 1 at the end of the macro and I'm not understanding why. This macro is part of a larger problem I'm having but I've narrowed it down to this small problem.
Code:
macro Tester
{
  ;Replace all instances of Error with 0
  Error equ 0
  ;0 should never equal 1
  if 0 = 1
  ;I also tried using 0 eq 1 with the same results
  ;if 0 eq 1
    ;This line shouldn't be assebled
    Error equ 1
  end if
  ;Right here if I used Error it is replaced with 1
}

Tester
    
Post 02 Jan 2006, 20:19
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7714
Location: Kraków, Poland
Tomasz Grysztar
Read the answer to fourth question in the FAQ and the section 2.3.7 of the manual.

Or in short: do not use equ here, use =.
Post 02 Jan 2006, 21:42
View user's profile Send private message Visit poster's website Reply with quote
Meor



Joined: 02 Jan 2006
Posts: 3
Meor
Thank you for the direction.
Post 02 Jan 2006, 21:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2020, Tomasz Grysztar.

Powered by rwasa.