flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > .if .esle .endif : ja or jg , jb or gl ?

Author
Thread Post new topic Reply to topic
3D_FASM



Joined: 11 May 2023
Posts: 24
3D_FASM 23 May 2023, 09:18
This is macro from extended versions of windows headers (which end in 'x'), for example, win32ax.inc.

How will this macro determine where to use ja and where jg?

Are there special comparison operators for signed and unsigned numbers? Or how?
Post 23 May 2023, 09:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20070
Location: In your JS exploiting you and your system
revolution 23 May 2023, 11:39
The source code suggests that you need to include the signed keyword to get signed jumps:
Code:
;...
      match =COND =signed v1>==v2, COND c
      \\\{
          cmp v1,v2
          jl label
          define COND
      \\\}
      match =COND =signed v1<==v2, COND c
      \\\{
          cmp v1,v2
          jg label
          define COND
      \\\}
      match =COND v1>==v2, COND c
      \\\{
          cmp v1,v2
          jb label
          define COND
      \\\}
      match =COND v1<==v2, COND c
      \\\{
          cmp v1,v2
          ja label
          define COND
      \\\}
;...    
Post 23 May 2023, 11:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8341
Location: Kraków, Poland
Tomasz Grysztar 23 May 2023, 19:01
It is mentioned in the documentation of extended headers (also present in PDF version).
Post 23 May 2023, 19:01
View user's profile Send private message Visit poster's website Reply with quote
3D_FASM



Joined: 11 May 2023
Posts: 24
3D_FASM 23 May 2023, 21:34
Yes, I have see. Can a single condition contain signed and unsigned comparisons?
Post 23 May 2023, 21:34
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8341
Location: Kraków, Poland
Tomasz Grysztar 24 May 2023, 07:29
3D_FASM wrote:
Yes, I have see. Can a single condition contain signed and unsigned comparisons?
Yes. You prepend a single comparison statement, not the entire expression.
Post 24 May 2023, 07:29
View user's profile Send private message Visit poster's website 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.