Author Topic: Why don't move?  (Read 353 times)

alex-rudenkiy

  • Regular Member
  • *
  • Posts: 21
Why don't move?
« on: July 02, 2017, 11:01:39 PM »
Why does an error occur when I want to move the number to xmm?

prog2.asm(14) : error A2085: instruction or register not accepted in current CPU mode
prog2.asm(15) : error A2085: instruction or register not accepted in current CPU mode


Code: [Select]
.686
.mmx
.xmm

option casemap:none

include \masm32\include\masm32rt.inc
include \masm32\macros\macros.asm
includelib \masm32\lib\kernel32.lib
include \masm32\include\kernel32.inc

.code
start:
movq xmm0, 9876543210
                movq xmm1, xmm0
end start
end main

felipe

  • Member
  • ***
  • Posts: 374
  • assemble the unassembled.
Re: Why don't move?
« Reply #1 on: July 03, 2017, 02:13:23 AM »
PHUK! It looks than this question has a simple answer, but i still haven't study this kind of instructions.   :bgrin:

Be patience. Wait for other replies.  :t

And yes, that's the best way of show your code.  ;)
Felipe.

JoeBr

  • Regular Member
  • *
  • Posts: 5
Re: Why don't move?
« Reply #2 on: July 03, 2017, 02:48:32 AM »
See http://x86.renejeschke.de/html/file_module_x86_id_201.html - the source operand needs to be either a memory reference/variable or another xmm register.

Which Assembler are you using?  MASM/UASM/FASM...?

Instead, you might use something like....

      .data
      qSrc dq   9876543210
      .code
      movq xmm0, qSrc
      movq xmm1, xmm0

(IF you're assembling 64-bit - 32 bit wouldn't work with the above as the constant loaded into qSrc is beyond a 32-bit value)

Joe

alex-rudenkiy

  • Regular Member
  • *
  • Posts: 21
Re: Why don't move?
« Reply #3 on: July 03, 2017, 04:58:52 PM »
masm32. Damn, it did not work, the same error :(

See http://x86.renejeschke.de/html/file_module_x86_id_201.html - the source operand needs to be either a memory reference/variable or another xmm register.

Which Assembler are you using?  MASM/UASM/FASM...?

Instead, you might use something like....

      .data
      qSrc dq   9876543210
      .code
      movq xmm0, qSrc
      movq xmm1, xmm0

(IF you're assembling 64-bit - 32 bit wouldn't work with the above as the constant loaded into qSrc is beyond a 32-bit value)

Joe

jj2007

  • Member
  • *****
  • Posts: 7756
  • Assembler is fun ;-)
    • MasmBasic
Re: Why don't move?
« Reply #4 on: July 03, 2017, 05:22:08 PM »
The order of the directives is important.

Code: [Select]
include \masm32\include\masm32rt.inc
.686p
.xmm

.code
myq dq 9876543210
start:
  movq xmm0, myq
  movaps xmm1, xmm0
  exit
end start

JoeBr

  • Regular Member
  • *
  • Posts: 5
Re: Why don't move?
« Reply #5 on: July 04, 2017, 02:49:05 AM »
Sorry, noob I am - I didn't note the directives order - JJ's code should work perfectly.   And you CAN use the (above-32-bit) value you note in the beginning, I believe it ties to the directives.  JJ - thanks!

Joe

alex-rudenkiy

  • Regular Member
  • *
  • Posts: 21
Re: Why don't move?
« Reply #6 on: July 04, 2017, 08:22:18 AM »
The order of the directives is important.

Code: [Select]
include \masm32\include\masm32rt.inc
.686p
.xmm

.code
myq dq 9876543210
start:
  movq xmm0, myq
  movaps xmm1, xmm0
  exit
end start

Thank you :t