flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > signed |
Author |
|
revolution 14 Dec 2005, 15:29
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)) |
|||
14 Dec 2005, 15:29 |
|
Tomasz Grysztar 14 Dec 2005, 18:02
"s<"? What language comes it from?
|
|||
14 Dec 2005, 18:02 |
|
vid 14 Dec 2005, 18:49
learn about "match{}" feature to achieve that. But rather thing if it is really nescessary.
|
|||
14 Dec 2005, 18:49 |
|
Matrix 15 Dec 2005, 09:31
asmgges wrote: Hi ! you meant, s<0 s>0 no? |
|||
15 Dec 2005, 09:31 |
|
asmgges 15 Dec 2005, 19:31
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 |
|||
15 Dec 2005, 19:31 |
|
Tomasz Grysztar 15 Dec 2005, 19:46
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. |
|||
15 Dec 2005, 19:46 |
|
asmgges 16 Dec 2005, 10:11
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 |
|||
16 Dec 2005, 10:11 |
|
madmatt 16 Dec 2005, 11:20
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? |
|||
16 Dec 2005, 11:20 |
|
asmgges 16 Dec 2005, 14:01
Hi ! madmatt
Yes just over-writing I made many tests. Seem very well to work. Friendly...AsmGges |
|||
16 Dec 2005, 14:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.