View previous topic :: View next topic |
Author |
Message |
Noobrzor Advanced Cheater
Reputation: 0
Joined: 19 May 2014 Posts: 74
|
Posted: Wed Jan 13, 2016 2:37 pm Post subject: I don't get this 'comiss' behaviour |
|
|
Code: | amountY:
dd (float)211
newmem:
movss xmm0,[rcx+000010B4]
comiss xmm0,[amountY]
JL/JG returnhere
addss xmm0,[amountX]
movss [rcx+000010B4],xmm0
jmp returnhere |
I don't get it. The comiss absolutely doesn't work here, and I had it working somewhere earlier like this.
When [rcx+000010B4] and therefore xmm0 (I had tested whether the xmm0 returns correct with a separate registersymbol and viewed in cheat engine) is EITHER above or below amountY:
-jl -> never jumps to returnhere, so xmm0 keeps increasing by amountX perpetually, as if comiss never existed in the first place
-jg -> always jumps to returnhere, as if a jmp was put there instead.
What the heck?
EDIT/SOLVED:
JA and JB worked perfectly.
Additional question from me, copied from my third post down the topic:
So, it seems for signed normal integers you need jg and jl, but for floats ja and jb are all right? How come this difference?
Last edited by Noobrzor on Wed Jan 13, 2016 3:59 pm; edited 2 times in total |
|
Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Wed Jan 13, 2016 2:45 pm Post subject: |
|
|
What is the value stored in "[rcx+10b4]"?
Because if it's always lower than the one stored in xmm0 (211.0), then of course it always jumps at "jg" ...
|
|
Back to top |
|
 |
Noobrzor Advanced Cheater
Reputation: 0
Joined: 19 May 2014 Posts: 74
|
Posted: Wed Jan 13, 2016 2:53 pm Post subject: |
|
|
I meant it always jumps at JG whether xmm0 or rcx+10b is float 111 or float 333.
I said it, I believe - "When [rcx+000010B4] and therefore xmm0 (I had tested whether the xmm0 returns correct with a separate registersymbol and viewed in cheat engine) is EITHER above or below amountY: "
|
|
Back to top |
|
 |
akumakuja28 Master Cheater
Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Wed Jan 13, 2016 3:32 pm Post subject: |
|
|
Comiss is a brain breaker sometimes.
But use jb and ja instead of jl, jg
Jump below, jb
Jump above, ja
_________________
Last edited by akumakuja28 on Thu Jan 14, 2016 1:35 am; edited 1 time in total |
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Wed Jan 13, 2016 3:35 pm Post subject: |
|
|
Use ja/jb.
|
|
Back to top |
|
 |
Noobrzor Advanced Cheater
Reputation: 0
Joined: 19 May 2014 Posts: 74
|
Posted: Wed Jan 13, 2016 3:55 pm Post subject: |
|
|
Unbelieveable coincidence. I had just tried doing exactly that, and it worked perfectly - whether I used down to negative float values or not.
I had been searching on float comparisons, and I found someone referring to comiss'es as to be used with jg and jl, not ja and jb.
Any way, both above responses had been problem-solving.
So, it seems for signed normal integers you need jg and jl, but for floats ja and jb are all right? How come this difference?
Last edited by Noobrzor on Wed Jan 13, 2016 4:00 pm; edited 1 time in total |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 150
Joined: 06 Jul 2014 Posts: 4652
|
Posted: Wed Jan 13, 2016 3:58 pm Post subject: |
|
|
From this reference:
Quote: | Compares the single-precision floating-point values in the low doublewords of source operand 1 (first operand) and source operand 2 (second operand), and sets the ZF, PF, and CF flags in the EFLAGS register according to the result (unordered, greater than, less than, or equal). The OF, SF, and AF flags in the EFLAGS register are set to 0. |
If you also look up the jcc instructions, you'd see the JG and JL instructions check the SF and OF flags (both always set to 0). The JA and JB instructions check the flags set according to the result of the comparison.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Noobrzor Advanced Cheater
Reputation: 0
Joined: 19 May 2014 Posts: 74
|
Posted: Wed Jan 13, 2016 4:02 pm Post subject: |
|
|
I see, thanks a lot for clearing it up.
To sum it up, cmp is different from comiss, and floats are different than normal integers in a way that JA and JB from comiss understands negative values inherently from floats with comiss, but in CMP it still is required to use JG and JL for negative values, yes?
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 150
Joined: 06 Jul 2014 Posts: 4652
|
|
Back to top |
|
 |
Noobrzor Advanced Cheater
Reputation: 0
Joined: 19 May 2014 Posts: 74
|
Posted: Wed Jan 13, 2016 4:45 pm Post subject: |
|
|
Oh, I see. Thanks a lot for your help and time.
|
|
Back to top |
|
 |
|