Author Topic: How to make CMOVcc instructions available  (Read 4256 times)

BetrunkenUhrmacher

  • Guest
How to make CMOVcc instructions available
« 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:
Code: [Select]
.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

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: How to make CMOVcc instructions available
« Reply #1 on: July 04, 2012, 12:42:35 AM »
Code: [Select]
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

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How to make CMOVcc instructions available
« Reply #2 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

BetrunkenUhrmacher

  • Guest
Re: How to make CMOVcc instructions available
« Reply #3 on: July 04, 2012, 07:01:17 PM »
Now it works. Thanks a lot.