The MASM Forum

General => The Campus => Topic started by: BetrunkenUhrmacher on July 04, 2012, 12:37:35 AM

Title: How to make CMOVcc instructions available
Post by: BetrunkenUhrmacher on July 04, 2012, 12:37:35 AM
Hello folks, I'm new on the forum. I have some troubles with CMOVcc. I don't know how to make it available.
I use MASM32.

this is code:

.686
.model flat, stdcall
include \masm32\include\masm32rt.inc

.data
.code
start:
    mov ax, 4
    mov bx, 8
    cmp ax, 0
    cmovz ax, bx

    inkey
    exit
end start


and after assembling I get this error message:
"D:\masm32\tbc\cmov.asm(14) : error A2085: instruction or register not accepted in current CPU mode".

thanks in advance
Title: Re: How to make CMOVcc instructions available
Post by: dedndave on July 04, 2012, 12:42:35 AM
include \masm32\include\masm32rt.inc
.686


the masm32rt.inc file sets the processor to 486
(it also takes care of model and casemap)
but - set the processor to 686 after the include
Title: Re: How to make CMOVcc instructions available
Post by: hutch-- on July 04, 2012, 01:21:32 AM
Do the lot.


.686p
.mmx
.xmm


Unless you are writing code for a truly ancient processor, don't apply the restrictions of using old processor limits.
Title: Re: How to make CMOVcc instructions available
Post by: BetrunkenUhrmacher on July 04, 2012, 07:01:17 PM
Now it works. Thanks a lot.