flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
Code: if (value1+(1 shl 63))<(value2+(1 shl 63)) if (value1+(1 shl 63))>(value2+(1 shl 63)) if (value1+(1 shl 63))<=(value2+(1 shl 63)) if (value1+(1 shl 63))>=(value2+(1 shl 63)) |
|||
![]() |
|
Tomasz Grysztar
"s<"? What language comes it from?
|
|||
![]() |
|
vid
learn about "match{}" feature to achieve that. But rather thing if it is really nescessary.
|
|||
![]() |
|
Matrix
asmgges wrote: Hi ! you meant, s<0 s>0 no? |
|||
![]() |
|
asmgges
Hi! Matrix
![]() I am going to try to be clear (with my poor English it is not sure) In Fasm you have the hlls of comparisons .if .elseif .until .while with JNCOND who authorizes you this (and a little more still) but I write just the concerned parts Code: .if value1 = value2 ;or .if value1,e,value2 .if value1 <> value2 ;or .if value1,ne,value2 ;Unsigned .if value1 < value2 ;or .if value1,b,value2 .if value1 <= value2 ;or .if value1,be,value2 .if value1 > value2 ;or .if value1,a,value2 .if value1 >= value2 ;or .if value1,ae,value2 ;Signed .if value1,l,value2 .if value1,le,value2 .if value1,g,value2 .if value1,ge,value2 I would like to be able to replace the signed conditions , l , le , g , ge, by the symbolic of replacements: s< s<= s> s>= As see below: Code: ;Signed ;;;;;;;.if value1,l,value2 .if value1 s< value2 ;;;;;;;.if value1,le,value2 .if value1 s<= value2 ;;;;;;;.if value1,g,value2 .if value1 s> value2 ;;;;;;;.if value1,ge,value2 .if value1 s>= value2 I did not find how to make to integrate in JNCOND I redefined others macros as .if_signed and friends with JNCONDSIGNED and the same symbolism as the unsigned values. Code: .if_signed value1 < value2 ; l .if_signed value1 <= value2 ; le .if_signed value1 > value2 ; g .if_signed value1 >= value2 ; ge ; Signed ; .if_signed v1 cond v2 cond: < <= > >= macro .if_signed [arg] { common __IF equ local ..endif __ENDIF equ ..endif local ..else __ELSE equ ..else JNCONDSIGNED __ELSE,arg } macro JNCONDSIGNED label,[conds] { common match =CONDS v1>==v2, CONDS conds ;>= \{ cmp v1,v2 jl label CONDS equ \} match =CONDS v1<==v2, CONDS conds ;<= \{ cmp v1,v2 jg label CONDS equ \} match =CONDS v1>v2, CONDS conds ;> \{ cmp v1,v2 jle label CONDS equ \} match =CONDS v1<v2, CONDS conds ;< \{ cmp v1,v2 jge label CONDS equ \} restore CONDS } But do not waste your time resolving this minor problem ![]() Friendly...AsmGges |
|||
![]() |
|
Tomasz Grysztar
You can integrate it into JNCOND like this:
Code: match =COND v1=s>v2, COND cond \{ cmp v1,v2 jle label COND equ \} match =COND v1>v2, COND cond \{ cmp v1,v2 jbe label COND equ \} Read more about "match" directive to learn how it works. |
|||
![]() |
|
asmgges
Hi!
![]() Tomasz wrote Quote:
Euh! euh! Bof.... Seen in another life and on another planet ... I am maybe one similar parent of the kind extraterrestrial ET Or born over MARS. Or I maybe sucked too much chocolate bar of the same name in my youth..... ![]() More seriously,thanks for solution,run fine,add this block in beginning of JNCOND Code: macro JNCOND label,[cond] { common match =COND v1=s>==v2, COND cond ; symbol s>= \{ cmp v1,v2 jl label COND equ \} match =COND v1=s<==v2, COND cond ; symbol s<= \{ cmp v1,v2 jg label COND equ \} match =COND v1=s<v2, COND cond ; symbol s< \{ cmp v1,v2 jge label COND equ \} match =COND v1=s>v2, COND cond ; symbol s> \{ cmp v1,v2 jle label COND equ \} Friendly...AsmGges |
|||
![]() |
|
madmatt
Hello Asmgges,
So now do these macros work with signed values? Good work! So add this code to the JCOND block?, without over-writing anything else? |
|||
![]() |
|
asmgges
Hi ! madmatt
![]() Yes just over-writing I made many tests. Seem very well to work. Friendly...AsmGges |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.