Author Topic: [SOLVED] subsd: mismatch in operand sizes  (Read 11008 times)

Offline axper

  • Jr. Member
  • *
  • Posts: 4
[SOLVED] subsd: mismatch in operand sizes
« on: February 04, 2014, 08:26:20 AM »
Can't understand what I am doing wrong here
Code: [Select]
global main

SECTION .bss
number:
resq    1

SECTION .text
main:
subsd xmm2, qword [rbx]

; Exit
mov rbx, 0
mov rax, 1
int 0x80
Compiling with
Code: [Select]
nasm -felf64 file.asm

The manual says this about subsd:
Quote
Subtracts the low double-precision floating-point value in the source operand (second operand) from the low
double-precision floating-point value in the destination operand (first operand), and stores the double-precision
floating-point result in the destination operand. The source operand can be an XMM register or a 64-bit memory
location. The destination operand is an XMM register. The high quadword of the destination operand remains
unchanged.
My second operand is a 64-bit memory location. What's wrong here?
« Last Edit: February 04, 2014, 09:05:57 AM by axper »

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: subsd: mismatch in operand sizes
« Reply #1 on: February 04, 2014, 09:00:57 AM »
Hi!

You have to specify - only a memory location.

It compiles fine without "qword", like this:
Code: [Select]
subsd xmm2,[rbx]



Encryptor256's Investigation \ Research Department.

Offline axper

  • Jr. Member
  • *
  • Posts: 4
Re: subsd: mismatch in operand sizes
« Reply #2 on: February 04, 2014, 09:05:21 AM »
That worked, thank you!

Offline HD1920.1

  • Jr. Member
  • *
  • Posts: 40
Re: [SOLVED] subsd: mismatch in operand sizes
« Reply #3 on: February 06, 2014, 02:49:21 PM »
XMM registers are 128 bit, so you have to use oword or nothing.