The MASM Forum

General => The Campus => Topic started by: frktons on December 05, 2012, 08:37:42 AM

Title: error A2005:symbol redefinition : movbe
Post by: frktons on December 05, 2012, 08:37:42 AM
In one of my routines I'm trying to use MOVBE
but MASM complains.

The two instructions where I use it are:

            movbe dword ptr [ebx], edx
            movbe dword ptr [eax], edi


and another strange error in REPEAT/ENDM [I think]:
Quote
Microsoft (R) Macro Assembler Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

Assembling: F:\Esempi_PGM\Assembly\TestReverse2.asm
F:\Esempi_PGM\Assembly\TestReverse2.asm(187) : error A2005:symbol redefinition : movbe
MacroLoop(50): teration 1: Macro Called From
  F:\Esempi_PGM\Assembly\TestReverse2.asm(187): Main Line Code
F:\Esempi_PGM\Assembly\TestReverse2.asm(187) : error A2005:symbol redefinition : movbe
MacroLoop(49): teration 2: Macro Called From
  F:\Esempi_PGM\Assembly\TestReverse2.asm(187): Main Line Code
F:\Esempi_PGM\Assembly\TestReverse2.asm(187) : error A2005:symbol redefinition : movbe
MacroLoop(50): teration 2: Macro Called From
  F:\Esempi_PGM\Assembly\TestReverse2.asm(187): Main Line Code
F:\Esempi_PGM\Assembly\TestReverse2.asm(188) : error A2016:expression expected
MacroLoop(49): teration 1: Macro Called From
  F:\Esempi_PGM\Assembly\TestReverse2.asm(188): Main Line Code
F:\Esempi_PGM\Assembly\TestReverse2.asm(188) : error A2138:invalid data initializer
MacroLoop(49): teration 1: Macro Called From
  F:\Esempi_PGM\Assembly\TestReverse2.asm(188): Main Line Code
_
Assembly Error

If I change:

            movbe dword ptr [ebx], edx
            movbe dword ptr [eax], edi


with


            movbe [ebx], edx
            movbe [eax], edi


The first error goes away, but the second stays put.  ::)

What could it be.
Attached the complete prog.
Title: Re: error A2005:symbol redefinition : movbe
Post by: qWord on December 05, 2012, 08:50:31 AM
movbe means CMOVBE? The conditional moves  can only have a register as destination (See the manuals!!!).
Title: Re: error A2005:symbol redefinition : movbe
Post by: frktons on December 05, 2012, 09:01:12 AM
Quote from: qWord on December 05, 2012, 08:50:31 AM
movbe means CMOVBE? The conditional moves  can only have a register as destination (See the manuals!!!).
Intel says:
Quote
Performs a byte swap operation on the data copied from the second operand (source
operand) and store the result in the first operand (destination operand). The source
operand can be a general-purpose register, or memory location; the destination
register can be a general-purpose register, or a memory location; however, both
operands can not be registers, and only one operand can be a memory location. Both
operands must be the same size, which can be a word, a doubleword or quadword.
The MOVBE instruction is provided for swapping the bytes on a read from memory or
on a write to memory; thus providing support for converting little-endian values to
big-endian format and vice versa.
It is not a conditional move, if I understand correctly.
Title: Re: error A2005:symbol redefinition : movbe
Post by: hutch-- on December 05, 2012, 09:11:09 AM
Frank,

Two things, does your processor support that opcode AND does the MASM version you are using support that opcode ?
Title: Re: error A2005:symbol redefinition : movbe
Post by: qWord on December 05, 2012, 09:13:28 AM
A quick search shows that this instruction is only suppored by Intel's Atom processors. Maybe not that usfull for common code.

http://software.intel.com/en-us/articles/disable-movbe-to-test-intel-atom-targeted-code-on-non-atom-platforms/

Later: the replacemnt is simply :
mov reg,data
bswap reg
mov dest,reg

Strange that they introduce a new instruction for that...
Title: Re: error A2005:symbol redefinition : movbe
Post by: frktons on December 05, 2012, 09:26:40 AM
Quote from: hutch-- on December 05, 2012, 09:11:09 AM
Frank,

Two things, does your processor support that opcode AND does the MASM version you are using support that opcode ?

Steve,

probably my CPU doesn't, and the same for MASM , it complains.

Quote from: qWord on December 05, 2012, 09:13:28 AM
A quick search shows that this instruction is only suppored by Intel's Atom processors. Maybe not that usfull for common code.

http://software.intel.com/en-us/articles/disable-movbe-to-test-intel-atom-targeted-code-on-non-atom-platforms/

Later: the replacemnt is simply :
mov reg,data
bswap reg
mov dest,reg

Strange that they introduce a new instruction for that...

Thanks qWord, I thought the manuals were for all x86 CPUs.
I discovered it by chance and I was curious about its performance.



Title: Re: error A2005:symbol redefinition : movbe
Post by: qWord on December 05, 2012, 09:38:28 AM
Quote from: frktons on December 05, 2012, 09:26:40 AMprobably my CPU doesn't, and the same for MASM , it complains.
ML version 11 support that instruction.
Title: Re: error A2005:symbol redefinition : movbe
Post by: frktons on December 05, 2012, 09:41:39 AM
Quote from: qWord on December 05, 2012, 09:38:28 AM
Quote from: frktons on December 05, 2012, 09:26:40 AMprobably my CPU doesn't, and the same for MASM , it complains.
ML version 11 support that instruction.

Good to know. If I'll have an Atom CPU I'll use it.