NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: axper on February 04, 2014, 08:26:20 AM

Title: [SOLVED] subsd: mismatch in operand sizes
Post by: axper 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 (http://"http://http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-2b-manual.html") 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?
Title: Re: subsd: mismatch in operand sizes
Post by: encryptor256 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]



Title: Re: subsd: mismatch in operand sizes
Post by: axper on February 04, 2014, 09:05:21 AM
That worked, thank you!
Title: Re: [SOLVED] subsd: mismatch in operand sizes
Post by: HD1920.1 on February 06, 2014, 02:49:21 PM
XMM registers are 128 bit, so you have to use oword or nothing.