flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > .if CARRY?

Author
Thread Post new topic Reply to topic
gandalf



Joined: 27 Feb 2009
Posts: 31
gandalf 01 Mar 2009, 15:36
In FASM 1.67.33 the two pieces of code (16-bit real mode)
Code:
  .if ~CARRY? & eax=534d4150h
  ...
  .endif
    

and
Code:
  .if (~CARRY?) & eax=534d4150h
  ...
  .endif
    

produce

Code:
  jc    skip
  cmp eax, 534d4150h
  jz    skip
    


Why?
Post 01 Mar 2009, 15:36
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 01 Mar 2009, 16:00
Seems like a bug in macros. I will try to fix it soon.

Note, that ".if" is just a macro (defined in include\macro\if.inc), nothing built-in into fasm, so it doesn't much matter which fasm version it is.
Post 01 Mar 2009, 16:00
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 01 Mar 2009, 16:28
OK, I've got the fix. In the IF.INC file, in the PARSECOND macro, find fragment that looks like:
Code:
      match &,symb
      \\\{
          parsed equ parsed,&,
          define status@cond
          define symb@cond
      \\\}
      match |,symb
      \\\{
          parsed equ parsed,|,
          define status@cond
          define symb@cond
      \\\}    

and fix it like this:
Code:
      match &,symb
      \\\{
          parsed equ parsed,&,
          define status@cond
          define symb@cond
          define neg@cond
      \\\}
      match |,symb
      \\\{
          parsed equ parsed,|,
          define status@cond
          define symb@cond
          define neg@cond
      \\\}    


I will include this fix with the new package update I'm preparing today.
Post 01 Mar 2009, 16:28
View user's profile Send private message Visit poster's website Reply with quote
gandalf



Joined: 27 Feb 2009
Posts: 31
gandalf 01 Mar 2009, 16:45
Tomasz Grysztar wrote:
Seems like a bug in macros. I will try to fix it soon.

Note, that ".if" is just a macro (defined in include\macro\if.inc), nothing built-in into fasm, so it doesn't much matter which fasm version it is.


I know it's a macro but I thought it was strange nobody noticed it. I thought that maybe you modified the "macro engine" in one of your latest releases.

Thanks for the instantaneous fix!
Post 01 Mar 2009, 16:45
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.