flat assembler
Message board for the users of flat assembler.

Index > Main > movcc

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1080
Location: Belgium
ouadji 28 Sep 2010, 08:04

Your Opinion about this ?

Can one consider that currently (2010) a program which uses "movcc"
is able to run on all PCs ? ... (or not)

or is it better not to use this instruction ?


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 28 Sep 2010, 08:04
View user's profile Send private message Send e-mail Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 28 Sep 2010, 08:14
I would use it, and also define a minimum processor spec in the readme.txt file.
Post 28 Sep 2010, 08:14
View user's profile Send private message Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 28 Sep 2010, 08:19
no way.
i remember it has a cpuid code to determine if its supported.
Post 28 Sep 2010, 08:19
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20689
Location: In your JS exploiting you and your system
revolution 28 Sep 2010, 11:19
I use a macro to simulate it in fasmarm. For most practical situations the user will never know the difference.

[edit] I guess it would be helpful to post the macro:
Code:
irp cc,a,ae,b,be,c,e,g,ge,l,le,na,nae,nb,nbe,nc,ne,ng,nge,nl,nle,no,np,ns,nz,o,p,pe,po,s,z {
        local i
     macro cmov#cc [args] \{
           \common
            \local .x
              j#cc    .x
          load    i from $-2
          store   (i xor 1) at $-2
            mov     args
            .x:
 \}
}    
Post 28 Sep 2010, 11:19
View user's profile Send private message Visit poster's website Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 28 Sep 2010, 12:43
jcc will generate exception even if condition is not met.
so this macroand this macro wont. there is a diffrence.
Post 28 Sep 2010, 12:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20689
Location: In your JS exploiting you and your system
revolution 28 Sep 2010, 12:56
b1528932 wrote:
jcc will generate exception even if condition is not met.
so this macroand this macro wont. there is a diffrence.
The macro works. Maybe you are thinking of setcc?

[edit] Oh, I just realised what you mean. A bad memory address will raise an exception. Yeah, okay, it will. So I guess it could fail for something like stack touching routines.
Post 28 Sep 2010, 12:56
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1080
Location: Belgium
ouadji 28 Sep 2010, 16:54

If I understand correctly, even today, it's better not to use this instruction
If one wishes that a program can run on most PCs.
So, "in practice", this instruction is unusable.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 28 Sep 2010, 16:54
View user's profile Send private message Send e-mail Reply with quote
Fanael



Joined: 03 Jul 2009
Posts: 168
Fanael 28 Sep 2010, 17:27
Quite frankly, have anyone heard of anybody running modern operating system on x86 CPU that does not support conditional moves (i.e. early PPros and older processors)?
Post 28 Sep 2010, 17:27
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4249
Location: vpcmpistri
bitRAKE 28 Sep 2010, 17:38
Terje Mathisen wrote:
CMOVcc was especially designed for those few short branches which really cannot be predicted!
It's not used in general because it is slower in the general case.
Post 28 Sep 2010, 17:38
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.