Author Topic: error A2005:symbol redefinition : movbe  (Read 8977 times)

frktons

  • Member
  • ***
  • Posts: 491
error A2005:symbol redefinition : movbe
« 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:
Code: [Select]
            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:
Code: [Select]
            movbe dword ptr [ebx], edx
            movbe dword ptr [eax], edi

with

Code: [Select]
            movbe [ebx], edx
            movbe [eax], edi

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

What could it be.
Attached the complete prog.

qWord

  • Member
  • *****
  • Posts: 1471
  • The base type of a type is the type itself
    • SmplMath macros
Re: error A2005:symbol redefinition : movbe
« Reply #1 on: December 05, 2012, 08:50:31 AM »
movbe means CMOVBE? The conditional moves  can only have a register as destination (See the manuals!!!).
MREAL macros - when you need floating point arithmetic while assembling!

frktons

  • Member
  • ***
  • Posts: 491
Re: error A2005:symbol redefinition : movbe
« Reply #2 on: December 05, 2012, 09:01:12 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.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4935
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: error A2005:symbol redefinition : movbe
« Reply #3 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 ?
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

qWord

  • Member
  • *****
  • Posts: 1471
  • The base type of a type is the type itself
    • SmplMath macros
Re: error A2005:symbol redefinition : movbe
« Reply #4 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 :
Code: [Select]
mov reg,data
bswap reg
mov dest,reg
Strange that they introduce a new instruction for that...
MREAL macros - when you need floating point arithmetic while assembling!

frktons

  • Member
  • ***
  • Posts: 491
Re: error A2005:symbol redefinition : movbe
« Reply #5 on: December 05, 2012, 09:26:40 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.

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 :
Code: [Select]
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.




qWord

  • Member
  • *****
  • Posts: 1471
  • The base type of a type is the type itself
    • SmplMath macros
Re: error A2005:symbol redefinition : movbe
« Reply #6 on: December 05, 2012, 09:38:28 AM »
probably my CPU doesn't, and the same for MASM , it complains.
ML version 11 support that instruction.
MREAL macros - when you need floating point arithmetic while assembling!

frktons

  • Member
  • ***
  • Posts: 491
Re: error A2005:symbol redefinition : movbe
« Reply #7 on: December 05, 2012, 09:41:39 AM »
probably 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.